You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by liancheng <gi...@git.apache.org> on 2015/11/02 15:38:03 UTC

[GitHub] spark pull request: [SPARK-10533] [SQL] handle scientific notation...

Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9085#discussion_r43633782
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/AbstractSparkSQLParser.scala ---
    @@ -102,8 +106,12 @@ class SqlLexical extends StdLexical {
       }
     
       override lazy val token: Parser[Token] =
    -    ( identChar ~ (identChar | digit).* ^^
    -      { case first ~ rest => processIdent((first :: rest).mkString) }
    +    ( rep1(digit) ~ ('.' ~> digit.*).? ~ (exp ~> sign.? ~ rep1(digit)) ^^ {
    +        case i ~ None ~ (sig ~ rest) =>
    +          DecimalLit(i.mkString + "e" + sig.getOrElse("") + rest.mkString)
    --- End diff --
    
    Nit: `sig.getOrElse("")` can be simplified to `sig.mkString`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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