Commit 84284e8
[SPARK-18053][SQL] compare unsafe and safe complex-type values correctly
## What changes were proposed in this pull request?
In Spark SQL, some expression may output safe format values, e.g. `CreateArray`, `CreateStruct`, `Cast`, etc. When we compare 2 values, we should be able to compare safe and unsafe formats.
The `GreaterThan`, `LessThan`, etc. in Spark SQL already handles it, but the `EqualTo` doesn't. This PR fixes it.
## How was this patch tested?
new unit test and regression test
Author: Wenchen Fan <[email protected]>
Closes #15929 from cloud-fan/type-aware.1 parent 85235ed commit 84284e8
File tree
5 files changed
+59
-35
lines changed- sql
- catalyst/src
- main
- java/org/apache/spark/sql/catalyst/expressions
- scala/org/apache/spark/sql/catalyst/expressions
- codegen
- test/scala/org/apache/spark/sql/catalyst/expressions
- core/src/test/scala/org/apache/spark/sql
5 files changed
+59
-35
lines changedLines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | 581 | | |
| 582 | + | |
587 | 583 | | |
588 | 584 | | |
589 | 585 | | |
| |||
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
484 | 487 | | |
485 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
486 | 491 | | |
487 | 492 | | |
488 | 493 | | |
| |||
512 | 517 | | |
513 | 518 | | |
514 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
515 | 525 | | |
516 | 526 | | |
517 | 527 | | |
| |||
551 | 561 | | |
552 | 562 | | |
553 | 563 | | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
554 | 569 | | |
555 | 570 | | |
556 | 571 | | |
| |||
561 | 576 | | |
562 | 577 | | |
563 | 578 | | |
564 | | - | |
| 579 | + | |
| 580 | + | |
565 | 581 | | |
566 | 582 | | |
567 | 583 | | |
| |||
Lines changed: 4 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| 391 | + | |
| 392 | + | |
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
| |||
429 | 431 | | |
430 | 432 | | |
431 | 433 | | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
| 434 | + | |
443 | 435 | | |
444 | 436 | | |
445 | 437 | | |
| |||
482 | 474 | | |
483 | 475 | | |
484 | 476 | | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
| 477 | + | |
494 | 478 | | |
495 | 479 | | |
496 | 480 | | |
| |||
513 | 497 | | |
514 | 498 | | |
515 | 499 | | |
516 | | - | |
517 | | - | |
518 | 500 | | |
519 | 501 | | |
520 | 502 | | |
| |||
527 | 509 | | |
528 | 510 | | |
529 | 511 | | |
530 | | - | |
531 | | - | |
532 | 512 | | |
533 | 513 | | |
534 | 514 | | |
| |||
541 | 521 | | |
542 | 522 | | |
543 | 523 | | |
544 | | - | |
545 | | - | |
546 | 524 | | |
547 | 525 | | |
548 | 526 | | |
| |||
555 | 533 | | |
556 | 534 | | |
557 | 535 | | |
558 | | - | |
559 | | - | |
560 | 536 | | |
561 | 537 | | |
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
293 | 295 | | |
294 | 296 | | |
295 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
296 | 325 | | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2469 | 2469 | | |
2470 | 2470 | | |
2471 | 2471 | | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
2472 | 2479 | | |
0 commit comments