[
https://issues.apache.org/jira/browse/HIVE-416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699853#action_12699853
]
Zheng Shao commented on HIVE-416:
---------------------------------
1. I checked the generated code for {k=5;}, it's a nested if so there is no
performance penalty. But I agree most grammars have k up to 3, and it should be
easy to extract the common prefix, so I will do it.
2. optional brackets won't be possible with a LL(k) parser with any k (without
backtrack), because I can construct an arbitarily long string like
"(((((((a+b..." and it's not possible to know whether the first "(" is the
optional bracket or not.
Most people who has been using "SELECT TRANSFORM" are adding the brackets,
while those using "MAP/REDUCE" are probably not (think "MAP" / "REDUCE" similar
to "SELECT"), that's why I made the choice like that. We can discuss more on
this if needed.
> 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.