yaooqinn commented on a change in pull request #32176:
URL: https://github.com/apache/spark/pull/32176#discussion_r614096789
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -2306,12 +2307,24 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef]
with SQLConfHelper with Logg
}
/**
- * Create a [[CalendarInterval]] literal expression. Two syntaxes are
supported:
+ * Create a [[CalendarInterval]] or ANSI interval literal expression.
+ * Two syntaxes are supported:
* - multiple unit value pairs, for instance: interval 2 months 2 days.
* - from-to unit, for instance: interval '1-2' year to month.
*/
override def visitInterval(ctx: IntervalContext): Literal = withOrigin(ctx) {
- Literal(parseIntervalLiteral(ctx), CalendarIntervalType)
+ val parsedInterval = parseIntervalLiteral(ctx)
+ if (SQLConf.get.legacyIntervalEnabled) {
Review comment:
nit: `conf.legacyIntervalEnabled`
--
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]