Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10745#discussion_r49801229
  
    --- Diff: 
sql/catalyst/src/main/antlr3/org/apache/spark/sql/catalyst/parser/ExpressionParser.g
 ---
    @@ -163,22 +163,38 @@ timestampLiteral
     
     intervalLiteral
         :
    -    KW_INTERVAL StringLiteral qualifiers=intervalQualifiers ->
    -    {
    -      adaptor.create($qualifiers.tree.token.getType(), $StringLiteral.text)
    +    (KW_INTERVAL intervalConstant KW_YEAR KW_TO KW_MONTH) => KW_INTERVAL 
intervalConstant KW_YEAR KW_TO KW_MONTH
    +      -> ^(TOK_INTERVAL_YEAR_MONTH_LITERAL intervalConstant)
    +    | (KW_INTERVAL intervalConstant KW_DAY KW_TO KW_SECOND) => KW_INTERVAL 
intervalConstant KW_DAY KW_TO KW_SECOND
    +      -> ^(TOK_INTERVAL_DAY_TIME_LITERAL intervalConstant)
    +    | KW_INTERVAL
    +      ((intervalConstant KW_YEAR)=> year=intervalConstant KW_YEAR)?
    +      ((intervalConstant KW_MONTH)=> month=intervalConstant KW_MONTH)?
    +      ((intervalConstant KW_WEEK)=> week=intervalConstant KW_WEEK)?
    +      ((intervalConstant KW_DAY)=> day=intervalConstant KW_DAY)?
    +      ((intervalConstant KW_HOUR)=> hour=intervalConstant KW_HOUR)?
    +      ((intervalConstant KW_MINUTE)=> minute=intervalConstant KW_MINUTE)?
    +      ((intervalConstant KW_SECOND)=> second=intervalConstant KW_SECOND)?
    +      (millisecond=intervalConstant KW_MILLISECOND)?
    +      (microsecond=intervalConstant KW_MICROSECOND)?
    +      -> ^(TOK_INTERVAL
    +          ^(TOK_INTERVAL_YEAR_LITERAL $year?)
    +          ^(TOK_INTERVAL_MONTH_LITERAL $month?)
    +          ^(TOK_INTERVAL_WEEK_LITERAL $week?)
    +          ^(TOK_INTERVAL_DAY_LITERAL $day?)
    +          ^(TOK_INTERVAL_HOUR_LITERAL $hour?)
    +          ^(TOK_INTERVAL_MINUTE_LITERAL $minute?)
    +          ^(TOK_INTERVAL_SECOND_LITERAL $second?)
    +          ^(TOK_INTERVAL_MILLISECOND_LITERAL $millisecond?)
    +          ^(TOK_INTERVAL_MICROSECOND_LITERAL $microsecond?))
    --- End diff --
    
    are you trying to support both hive's and our internal literal grammar?


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