@@ -478,7 +478,7 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
478478 ArrayMax (Literal .create(Seq (1.123 , 0.1234 , 1.121 ), ArrayType (DoubleType ))), 1.123 )
479479 }
480480
481- test(" Sequence" ) {
481+ test(" Sequence of numbers " ) {
482482 // test null handling
483483
484484 checkEvaluation(new Sequence (Literal (null , LongType ), Literal (1L )), null )
@@ -502,21 +502,6 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
502502 checkExceptionInExpression[IllegalArgumentException ](
503503 new Sequence (Literal (1 ), Literal (2 ), Literal (- 1 )), EmptyRow , " boundaries: 1 to 2 by -1" )
504504
505- checkExceptionInExpression[IllegalArgumentException ](
506- new Sequence (
507- Literal (Date .valueOf(" 1970-01-02" )),
508- Literal (Date .valueOf(" 1970-01-01" )),
509- Literal (CalendarInterval .fromString(" interval 1 day" ))),
510- EmptyRow , " sequence boundaries: 1 to 0 by 1" )
511-
512- checkExceptionInExpression[IllegalArgumentException ](
513- new Sequence (
514- Literal (Date .valueOf(" 1970-01-01" )),
515- Literal (Date .valueOf(" 1970-02-01" )),
516- Literal (CalendarInterval .fromString(" interval 1 month" ).negate())),
517- EmptyRow ,
518- s " sequence boundaries: 0 to 2678400000000 by - ${28 * CalendarInterval .MICROS_PER_DAY }" )
519-
520505 // test sequence with one element (zero step or equal start and stop)
521506
522507 checkEvaluation(new Sequence (Literal (1 ), Literal (1 ), Literal (- 1 )), Seq (1 ))
@@ -650,7 +635,7 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
650635 }
651636
652637 test(" Sequence on DST boundaries" ) {
653- val timeZone = TimeZone .getTimeZone(" CET " )
638+ val timeZone = TimeZone .getTimeZone(" Europe/Prague " )
654639 val dstOffset = timeZone.getDSTSavings
655640
656641 def noDST (t : Timestamp ): Timestamp = new Timestamp (t.getTime - dstOffset)
@@ -721,6 +706,21 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
721706 Date .valueOf(" 2019-06-01" ),
722707 Date .valueOf(" 2020-11-01" ),
723708 Date .valueOf(" 2022-04-01" )))
709+
710+ checkExceptionInExpression[IllegalArgumentException ](
711+ new Sequence (
712+ Literal (Date .valueOf(" 1970-01-02" )),
713+ Literal (Date .valueOf(" 1970-01-01" )),
714+ Literal (CalendarInterval .fromString(" interval 1 day" ))),
715+ EmptyRow , " sequence boundaries: 1 to 0 by 1" )
716+
717+ checkExceptionInExpression[IllegalArgumentException ](
718+ new Sequence (
719+ Literal (Date .valueOf(" 1970-01-01" )),
720+ Literal (Date .valueOf(" 1970-02-01" )),
721+ Literal (CalendarInterval .fromString(" interval 1 month" ).negate())),
722+ EmptyRow ,
723+ s " sequence boundaries: 0 to 2678400000000 by - ${28 * CalendarInterval .MICROS_PER_DAY }" )
724724 }
725725 }
726726
0 commit comments