Skip to content

Commit

Permalink
day and year interval test cases are also support
Browse files Browse the repository at this point in the history
  • Loading branch information
TJX2014 committed Jun 13, 2020
1 parent f970add commit c1765e1
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1838,11 +1838,20 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
}

test("SPARK-31980: Start and end equal in month range") {
checkEvaluation(new Sequence(
Literal(Date.valueOf("2018-01-01")),
Literal(Date.valueOf("2018-01-01")),
Literal(stringToInterval("interval 1 day"))),
Seq(Date.valueOf("2018-01-01")))
checkEvaluation(new Sequence(
Literal(Date.valueOf("2018-01-01")),
Literal(Date.valueOf("2018-01-01")),
Literal(stringToInterval("interval 1 month"))),
Seq(
Date.valueOf("2018-01-01")))
Seq(Date.valueOf("2018-01-01")))
checkEvaluation(new Sequence(
Literal(Date.valueOf("2018-01-01")),
Literal(Date.valueOf("2018-01-01")),
Literal(stringToInterval("interval 1 year"))),
Seq(Date.valueOf("2018-01-01")))
}
}

0 comments on commit c1765e1

Please sign in to comment.