sarutak commented on a change in pull request #32949:
URL: https://github.com/apache/spark/pull/32949#discussion_r666850179
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -2452,9 +2491,16 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef] with
SQLConfHelper with Logg
} else {
values(i).getText
}
+
UTF8String.fromString(" " + v + " " + u)
}
- IntervalUtils.stringToInterval(UTF8String.concat(kvs: _*))
+ val intervalLiteral = UTF8String.concat(kvs: _*)
+ val calendarInterval = IntervalUtils.stringToInterval(intervalLiteral)
+ if (!conf.legacyIntervalEnabled && isYearMonthInterval &&
isDayTimeInterval) {
+ throw
QueryParsingErrors.mixedIntervalUnitsError(intervalLiteral.toString.trim, ctx)
Review comment:
At first I tried to do so but building literal string will happen twice
(one in `visitMultiUnitsInterval` and one in `visitInterval`).
How about just removing the assertion here?
Or, is it acceptable to change `parseIntervalLiteral` and
`visitMultiUnitsInterval` for the purpose?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]