spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] cloud-fan commented on a change in pull request #26479: [SPARK-29855][SQL] typed literals with negative sign with proper result or exception
Date Tue, 12 Nov 2019 07:12:01 GMT
cloud-fan commented on a change in pull request #26479: [SPARK-29855][SQL] typed literals with
negative sign with proper result or exception
URL: https://github.com/apache/spark/pull/26479#discussion_r345044456
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
 ##########
 @@ -1860,16 +1860,19 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef]
with Logging
   override def visitTypeConstructor(ctx: TypeConstructorContext): Literal = withOrigin(ctx)
{
     val value = string(ctx.STRING)
     val valueType = ctx.identifier.getText.toUpperCase(Locale.ROOT)
+    val negativeSign = Option(ctx.negativeSign).map(_.getText).getOrElse("")
+    val isNegative = if (negativeSign == "-") true else false
 
 Review comment:
   do we really need to check `ctx.negativeSign.getText`? the parser rule is `MINUS? ...`

----------------------------------------------------------------
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


Mime
View raw message