Skip to content

Commit 816d384

Browse files
committed
tests
1 parent e655bba commit 816d384

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

spark/src/test/scala/org/apache/comet/exec/CometNativeReaderSuite.scala

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -436,15 +436,15 @@ class CometNativeReaderSuite extends CometTestBase with AdaptiveSparkPlanHelper
436436
"""
437437
|select 1 a
438438
|""".stripMargin,
439-
"select array(1, 2, 3, null) from tbl")
439+
"select array(1, 2, null, 3, null) from tbl")
440440
}
441441

442442
test("native reader - support ARRAY literal BOOL fields") {
443443
testSingleLineQuery(
444444
"""
445445
|select 1 a
446446
|""".stripMargin,
447-
"select array(true, false, null) from tbl")
447+
"select array(true, null, false, null) from tbl")
448448
}
449449

450450
test("native reader - support ARRAY literal NULL fields") {
@@ -468,87 +468,87 @@ class CometNativeReaderSuite extends CometTestBase with AdaptiveSparkPlanHelper
468468
"""
469469
|select 1 a
470470
|""".stripMargin,
471-
"select array(1, 2, 3, null) from tbl")
471+
"select array(1, 2, null, 3, null) from tbl")
472472
}
473473

474474
test("native reader - support ARRAY literal SHORT fields") {
475475
testSingleLineQuery(
476476
"""
477477
|select 1 a
478478
|""".stripMargin,
479-
"select array(cast(1 as short), cast(2 as short), cast(3 as short), null) from tbl")
479+
"select array(cast(1 as short), cast(2 as short), null, cast(3 as short), null) from tbl")
480480
}
481481

482482
test("native reader - support ARRAY literal DATE fields") {
483483
testSingleLineQuery(
484484
"""
485485
|select 1 a
486486
|""".stripMargin,
487-
"select array(CAST('2024-01-01' AS DATE), CAST('2024-02-01' AS DATE), CAST('2024-03-01' AS DATE), null) from tbl")
487+
"select array(CAST('2024-01-01' AS DATE), CAST('2024-02-01' AS DATE), null, CAST('2024-03-01' AS DATE), null) from tbl")
488488
}
489489

490490
test("native reader - support ARRAY literal LONG fields") {
491491
testSingleLineQuery(
492492
"""
493493
|select 1 a
494494
|""".stripMargin,
495-
"select array(cast(1 as bigint), cast(2 as bigint), cast(3 as bigint), null) from tbl")
495+
"select array(cast(1 as bigint), cast(2 as bigint), null, cast(3 as bigint), null) from tbl")
496496
}
497497

498498
test("native reader - support ARRAY literal TIMESTAMP fields") {
499499
testSingleLineQuery(
500500
"""
501501
|select 1 a
502502
|""".stripMargin,
503-
"select array(CAST('2024-01-01 10:00:00' AS TIMESTAMP), CAST('2024-01-02 10:00:00' AS TIMESTAMP), CAST('2024-01-03 10:00:00' AS TIMESTAMP), null) from tbl")
503+
"select array(CAST('2024-01-01 10:00:00' AS TIMESTAMP), CAST('2024-01-02 10:00:00' AS TIMESTAMP), null, CAST('2024-01-03 10:00:00' AS TIMESTAMP), null) from tbl")
504504
}
505505

506506
test("native reader - support ARRAY literal TIMESTAMP TZ fields") {
507507
testSingleLineQuery(
508508
"""
509509
|select 1 a
510510
|""".stripMargin,
511-
"select array(CAST('2024-01-01 10:00:00' AS TIMESTAMP_NTZ), CAST('2024-01-02 10:00:00' AS TIMESTAMP_NTZ), CAST('2024-01-03 10:00:00' AS TIMESTAMP_NTZ), null) from tbl")
511+
"select array(CAST('2024-01-01 10:00:00' AS TIMESTAMP_NTZ), CAST('2024-01-02 10:00:00' AS TIMESTAMP_NTZ), null, CAST('2024-01-03 10:00:00' AS TIMESTAMP_NTZ), null) from tbl")
512512
}
513513

514514
test("native reader - support ARRAY literal FLOAT fields") {
515515
testSingleLineQuery(
516516
"""
517517
|select 1 a
518518
|""".stripMargin,
519-
"select array(cast(1 as float), cast(2 as float), cast(3 as float), null) from tbl")
519+
"select array(cast(1 as float), cast(2 as float), null, cast(3 as float), null) from tbl")
520520
}
521521

522522
test("native reader - support ARRAY literal DOUBLE fields") {
523523
testSingleLineQuery(
524524
"""
525525
|select 1 a
526526
|""".stripMargin,
527-
"select array(cast(1 as double), cast(2 as double), cast(3 as double), null) from tbl")
527+
"select array(cast(1 as double), cast(2 as double), null, cast(3 as double), null) from tbl")
528528
}
529529

530530
test("native reader - support ARRAY literal STRING fields") {
531531
testSingleLineQuery(
532532
"""
533533
|select 1 a
534534
|""".stripMargin,
535-
"select array('a', 'bc', 'def', null) from tbl")
535+
"select array('a', 'bc', null, 'def', null) from tbl")
536536
}
537537

538538
test("native reader - support ARRAY literal DECIMAL fields") {
539539
testSingleLineQuery(
540540
"""
541541
|select 1 a
542542
|""".stripMargin,
543-
"select array(cast(1 as decimal(10, 2)), cast(2.5 as decimal(10, 2)),cast(3.75 as decimal(10, 2)), null) from tbl")
543+
"select array(cast(1 as decimal(10, 2)), cast(2.5 as decimal(10, 2)), null, cast(3.75 as decimal(10, 2)), null) from tbl")
544544
}
545545

546546
test("native reader - support ARRAY literal BINARY fields") {
547547
testSingleLineQuery(
548548
"""
549549
|select 1 a
550550
|""".stripMargin,
551-
"select array(cast('a' as binary), cast('bc' as binary), cast('def' as binary), null) from tbl")
551+
"select array(cast('a' as binary), cast('bc' as binary), null, cast('def' as binary), null) from tbl")
552552
}
553553

554554
test("SPARK-18053: ARRAY equality is broken") {

0 commit comments

Comments
 (0)