MaxGekk commented on a change in pull request #32296:
URL: https://github.com/apache/spark/pull/32296#discussion_r618415910
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -2395,13 +2395,22 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef]
with SQLConfHelper with Logg
*/
override def visitUnitToUnitInterval(ctx: UnitToUnitIntervalContext):
CalendarInterval = {
withOrigin(ctx) {
- val value = Option(ctx.intervalValue.STRING).map(string).getOrElse {
+ val value = Option(ctx.intervalValue.STRING).map(string).map { interval
=>
+ val sign = interval.startsWith("-")
+ val minus = ctx.intervalValue().MINUS() != null
+ (sign, minus) match {
+ case (true, true) => interval.replaceFirst("-", "")
+ case (false, true) => s"-$interval"
+ case (_, false) => interval
+ }
+ }.getOrElse {
throw QueryParsingErrors.invalidFromToUnitValueError(ctx.intervalValue)
}
+ println(value)
Review comment:
Could you remove println
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]