MaxGekk commented on a change in pull request #27596: [SPARK-30843][SQL] Fix
getting of time components before 1582 year
URL: https://github.com/apache/spark/pull/27596#discussion_r379888232
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
##########
@@ -1060,22 +1060,31 @@ class DateExpressionsSuite extends SparkFunSuite with
ExpressionEvalHelper {
outstandingTimezonesIds.foreach { timezone =>
var timestamp = MakeTimestamp(Literal(2019), Literal(8), Literal(10),
Literal(0), Literal(0), Literal(Decimal(BigDecimal(10.123456789), 8,
6)),
- Some(Literal(timezone)))
+ Some(Literal(timezone)), Some(timezone))
+ def millis(ts: MakeTimestamp): Milliseconds = Milliseconds(timestamp,
Some(timezone))
+ def micros(ts: MakeTimestamp): Microseconds = Microseconds(timestamp,
Some(timezone))
- checkEvaluation(Milliseconds(timestamp), Decimal(BigDecimal(10123.457),
8, 3))
- checkEvaluation(Microseconds(timestamp), 10123457)
+ checkEvaluation(millis(timestamp), Decimal(BigDecimal(10123.457), 8, 3))
+ checkEvaluation(
+ millis(timestamp.copy(year = Literal(10))),
+ Decimal(BigDecimal(10123.457), 8, 3))
+
+ checkEvaluation(micros(timestamp), 10123457)
+ checkEvaluation(
Review comment:
New test
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]