cloud-fan commented on a change in pull request #32949:
URL: https://github.com/apache/spark/pull/32949#discussion_r666838242
##########
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:
BTW we also check other errors in `parseIntervalLiteral`, which is the
caller side of `visitMultiUnitsInterval`/`visitUnitToUnitInterval`. I think
it's OK to check errors in the caller side if it makes the code simpler.
--
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]