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

    https://github.com/apache/spark/pull/2816#discussion_r18933954
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/SqlParser.scala ---
    @@ -300,11 +300,15 @@ class SqlParser extends AbstractSparkSQLParser {
       protected lazy val cast: Parser[Expression] =
         CAST ~ "(" ~> expression ~ (AS ~> dataType) <~ ")" ^^ { case exp ~ t 
=> Cast(exp, t) }
     
    -  protected lazy val literal: Parser[Literal] =
    -    ( numericLit ^^ {
    -        case i if i.toLong > Int.MaxValue => Literal(i.toLong)
    -        case i => Literal(i.toInt)
    -      }
    +  protected lazy val generalLiteral: Parser[Literal] =
    +    ( unsignedNumericLiteral ^^ {
    +      case n =>
    --- End diff --
    
    In the original code, variable i is always unsigned numeric expressed as 
String. If i is 9223372036854775808, i.toLong should fail because Long is 
between -9223372036854775808 and 9223372036854775807.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to