[ https://issues.apache.org/jira/browse/HIVE-15577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17080172#comment-17080172 ]
David Mollitor edited comment on HIVE-15577 at 4/10/20, 2:22 AM: ----------------------------------------------------------------- I am investigating [HIVE-23172] and I am having a problem addressing this because I am getting the following error from compiling the grammar: {code:none} hive-parser: Compilation failure [ERROR] /home/apache/hive/hive/parser/target/generated-sources/antlr3/org/apache/hadoop/hive/ql/parse/HiveParser.java:[40,38] code too large {code} I traced it down to the fact that there are too many token defined. In HiveParser.java, it has the following: {code:java} public static final String[] tokenNames = new String[] \{ ... }; {code} That list is so long, it's breaking Java compilation. I observed that the parser defines two token for most elements, for example: KW_TRUNCATE / TOK_TRUNCATETABLE I propose consolidating this down to one and conserve some space. I would propose just using KW_TRUNCATE and get rid of the TOK version. The same can be applied to quite a few ANTLR tokens. was (Author: belugabehr): I am investigating [HIVE-23172] and I am having a problem addressing this because I am getting the following error from compiling the grammar: {code:none} hive-parser: Compilation failure [ERROR] /home/apache/hive/hive/parser/target/generated-sources/antlr3/org/apache/hadoop/hive/ql/parse/HiveParser.java:[40,38] code too large {code} I traced it down to the fact that there are too many token defined. In HiveParser.java, it has the following: {code:java} public static final String[] tokenNames = new String[] \{ ... }; {code} That list is so long, it's breaking Java compilation. I observed that the parser defines two token for most elements, for example: KW_TRUNCATE / TOK_TRUNCATETABLE I propose consolidating this down to one and conserve some space. I would propose just using KW_TRUNCATE and get rid of the TOK version. > Simplify current parser > ----------------------- > > Key: HIVE-15577 > URL: https://issues.apache.org/jira/browse/HIVE-15577 > Project: Hive > Issue Type: Bug > Reporter: Pengcheng Xiong > Assignee: Pengcheng Xiong > Priority: Major > > We encountered "code too large" problem frequently. We need to reduce the > code size. -- This message was sent by Atlassian Jira (v8.3.4#803005)