hadoop-hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Namit Jain (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HIVE-416) Get rid of backtrack in Hive.g
Date Thu, 16 Apr 2009 20:20:15 GMT

    [ https://issues.apache.org/jira/browse/HIVE-416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699840#action_12699840
] 

Namit Jain commented on HIVE-416:
---------------------------------

I had some questions.

1. Wont it be better to factor out the common part in a seperate rule instead of providing
the look-ahead.
For eg:

instead of:

alterStatement
options {k=5;}
@init { msgs.push("alter statement"); }
@after { msgs.pop(); }
    : alterStatementRename
    | alterStatementAddCol
    | alterStatementDropPartitions
    | alterStatementAddPartitions
    | alterStatementProperties
    | alterStatementSerdeProperties
    ;


wont it be better to factor out < ALTER TABLE identifier> in a common and then have
the remaining rules ?


2.  On the same lines, I could not understand the reason for brackets around SELECT TRANSFORM
and
no brackets around MAP/REDUCE.


Instead of this:

selectClause
@init { msgs.push("select clause"); }
@after { msgs.pop(); }
    :
    KW_SELECT (KW_ALL | dist=KW_DISTINCT)?
    selectList -> {$dist == null}? ^(TOK_SELECT selectList)
               ->                  ^(TOK_SELECTDI selectList)
    |
    trfmClause  ->^(TOK_SELECT ^(TOK_SELEXPR trfmClause) )
    ;



if we factor out:

KW_SELECT for the first part and the transform clause, brackets should become optional.


Am I missing something here ?

> Get rid of backtrack in Hive.g
> ------------------------------
>
>                 Key: HIVE-416
>                 URL: https://issues.apache.org/jira/browse/HIVE-416
>             Project: Hadoop Hive
>          Issue Type: Improvement
>          Components: Query Processor
>    Affects Versions: 0.4.0
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>             Fix For: 0.4.0
>
>         Attachments: HIVE-416.1.patch
>
>
> Hive.g now still uses "backtrack=true". "backtrack" not only slows down the parsing in
case of error, it can also produce wrong syntax error messages (usually based on the last
try of the backtracking).
> We should follow http://www.antlr.org/wiki/display/ANTLR3/How+to+remove+global+backtracking+from+your+grammar
to remove the need of doing backtrack.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message