You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/21 10:26:46 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #26190: [SPARK-29532][SQL] simplify interval string parsing

cloud-fan commented on a change in pull request #26190: [SPARK-29532][SQL] simplify interval string parsing
URL: https://github.com/apache/spark/pull/26190#discussion_r336943569
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
 ##########
 @@ -1930,15 +1940,18 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging
    */
   override def visitIntervalField(ctx: IntervalFieldContext): CalendarInterval = withOrigin(ctx) {
     import ctx._
-    val s = value.getText
+    val s = if (value.STRING() != null) {
+      string(value.STRING())
 
 Review comment:
   This is to strip the `'` in the string, so that we don't need to deal with in the regex from `CalendarInterval`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org