cloud-fan commented on a change in pull request #32949:
URL: https://github.com/apache/spark/pull/32949#discussion_r666835198
##########
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:
I mean, can we do `throw QueryParsingErrors.mixedIntervalUnitsError`
inside `visitInterval`? The check here adds some duplicated code and looks a
bit convoluted.
--
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]