Revert "[SPARK-35778][SQL][TESTS] Check multiply/divide of year month interval of any fields by numeric"

### What changes were proposed in this pull request?
Revert 3904c0edba

### Why are the changes needed?
The merged test doesn't check different interval fields, actually. Need to apply this https://github.com/apache/spark/pull/33056 first of all.

### Does this PR introduce _any_ user-facing change?
No. This is tests.

### How was this patch tested?
By existing GAs.

Closes #33059 from MaxGekk/revert-Peng-Lei-SPARK-35778.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
This commit is contained in:
Max Gekk 2021-06-24 14:34:42 +03:00
parent cfcfbca965
commit 345d3db83d

View file

@ -325,6 +325,7 @@ class IntervalExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
checkException(days = Int.MaxValue)
}
// TODO(SPARK-35778): Check multiply/divide of year-month intervals of any fields by numeric
test("SPARK-34824: multiply year-month interval by numeric") {
Seq(
(Period.ofYears(-123), Literal(null, DecimalType.USER_DEFAULT)) -> null,
@ -336,9 +337,7 @@ class IntervalExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
(Period.ofYears(9999), 0.0001d) -> Period.ofYears(1),
(Period.ofYears(9999), BigDecimal(0.0001)) -> Period.ofYears(1)
).foreach { case ((period, num), expected) =>
DataTypeTestUtils.yearMonthIntervalTypes.foreach { dt =>
checkEvaluation(MultiplyYMInterval(Literal.create(period, dt), Literal(num)), expected)
}
checkEvaluation(MultiplyYMInterval(Literal(period), Literal(num)), expected)
}
Seq(
@ -399,6 +398,7 @@ class IntervalExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
}
}
// TODO(SPARK-35778): Check multiply/divide of year-month intervals of any fields by numeric
test("SPARK-34868: divide year-month interval by numeric") {
Seq(
(Period.ofYears(-123), Literal(null, DecimalType.USER_DEFAULT)) -> null,
@ -412,9 +412,7 @@ class IntervalExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
(Period.ofYears(1000), 100d) -> Period.ofYears(10),
(Period.ofMonths(2), BigDecimal(0.1)) -> Period.ofMonths(20)
).foreach { case ((period, num), expected) =>
DataTypeTestUtils.yearMonthIntervalTypes.foreach { dt =>
checkEvaluation(DivideYMInterval(Literal.create(period, dt), Literal(num)), expected)
}
checkEvaluation(DivideYMInterval(Literal(period), Literal(num)), expected)
}
Seq(