Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.3.4
-
None
-
None
Description
the sql is very long,about 3M size,use hive parse to parse the sql, it costs more than one hour to finish it. The reason is hive parse use IdentityHashMap, is not multi-thread safe, than it costs more than one hour to execute the code "while(true)"
my code is :
ParseDriver pd = new ParseDriver();
ASTNode tree = pd.parse(query, context);
while ((tree.getToken() == null) && (tree.getChildCount() > 0))
{ tree = (ASTNode) tree.getChild(0); }Map<Rule, NodeProcessor> rules = new LinkedHashMap<>();
Dispatcher disp = new DefaultRuleDispatcher(this, rules, null);
GraphWalker ogw = new DefaultGraphWalker(disp);
List<Node> topNodes = new ArrayList<>();
topNodes.add(tree);
ogw.startWalking(topNodes, null);