@@ -933,6 +933,13 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
933933 Literal (negateExact(stringToInterval(" interval 1 month" )))),
934934 EmptyRow ,
935935 s " sequence boundaries: 0 to 2678400000000 by - ${28 * MICROS_PER_DAY }" )
936+
937+ // SPARK-32133: Sequence step must be a day interval if start and end values are dates
938+ checkExceptionInExpression[IllegalArgumentException ](Sequence (
939+ Cast (Literal (" 2011-03-01" ), DateType ),
940+ Cast (Literal (" 2011-04-01" ), DateType ),
941+ Option (Literal (stringToInterval(" interval 1 hour" )))), null ,
942+ " sequence step must be a day interval if start and end values are dates" )
936943 }
937944 }
938945
@@ -1854,18 +1861,4 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
18541861 Literal (stringToInterval(" interval 1 year" ))),
18551862 Seq (Date .valueOf(" 2018-01-01" )))
18561863 }
1857-
1858- test(" SPARK-32133: Sequence step must be a day interval " +
1859- " if start and end values are dates" ) {
1860- checkExceptionInExpression[IllegalArgumentException ](Sequence (
1861- Cast (Literal (" 2011-03-01" ), DateType ),
1862- Cast (Literal (" 2011-04-01" ), DateType ),
1863- Option (Literal (stringToInterval(" interval 1 hour" )))), null ,
1864- " sequence step must be a day interval if start and end values are dates" )
1865- checkEvaluation(Sequence (
1866- Cast (Literal (" 2011-03-01" ), DateType ),
1867- Cast (Literal (" 2011-03-02" ), DateType ),
1868- Option (Literal (stringToInterval(" interval 1 day" )))),
1869- Seq (Date .valueOf(" 2011-03-01" ), Date .valueOf(" 2011-03-02" )))
1870- }
18711864}
0 commit comments