[SPARK-35088][SQL][FOLLOWUP] Add test case for TimestampNTZ sequence with default step

### What changes were proposed in this pull request?
This PR follows up https://github.com/apache/spark/pull/33360 and add test case for `TimestampNTZ` sequence with default step.

### Why are the changes needed?
Improve test coverage.

### Does this PR introduce _any_ user-facing change?
'No'.
Just add test cases.

### How was this patch tested?
New tests.

Closes #33462 from beliefer/SPARK-36090-followup.

Authored-by: gengjiaan <gengjiaan@360.cn>
Signed-off-by: Gengliang Wang <gengliang@apache.org>
This commit is contained in:
gengjiaan 2021-07-22 17:53:22 +08:00 committed by Gengliang Wang
parent bb09bd2e2d
commit 900b72a9cd

View file

@ -1325,6 +1325,23 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
Date.valueOf("2018-01-03"), Date.valueOf("2018-01-03"),
Date.valueOf("2018-01-02"), Date.valueOf("2018-01-02"),
Date.valueOf("2018-01-01"))) Date.valueOf("2018-01-01")))
// +/- 1 day for LocalDateTimes
checkEvaluation(new Sequence(
Literal(LocalDateTime.parse("2018-01-01T00:00:00")),
Literal(LocalDateTime.parse("2018-01-03T00:00:00"))),
Seq(
LocalDateTime.parse("2018-01-01T00:00:00"),
LocalDateTime.parse("2018-01-02T00:00:00"),
LocalDateTime.parse("2018-01-03T00:00:00")))
checkEvaluation(new Sequence(
Literal(LocalDateTime.parse("2018-01-03T00:00:00")),
Literal(LocalDateTime.parse("2018-01-01T00:00:00"))),
Seq(
LocalDateTime.parse("2018-01-03T00:00:00"),
LocalDateTime.parse("2018-01-02T00:00:00"),
LocalDateTime.parse("2018-01-01T00:00:00")))
} }
test("Reverse") { test("Reverse") {