Re: overwrite insert syntax

2016-09-16 Thread Julian Hyde
JavaCC is a top-down parser. This means it needs to know which rule to go into before it goes. It sees 'insert' and thinks 'hey, looks like this could be a SqlInsert()', and never bothers going into SqlInsertWithPartition. Top-down parsers are, in general, a Good Thing, because they are efficient.

Re: overwrite insert syntax

2016-09-16 Thread Arina Yelchiyeva
I used extension to the parser through freemarker template. I have added parsing SqlInsertWithPartition() for new sql construct (insert into t2 (c1, c2) partition by (c1) select c1, c2 from t1) By I keep getting the following error: PARSE ERROR: Encountered "partition" at line 1, column 30. Though

Re: overwrite insert syntax

2016-09-15 Thread Julian Hyde
Hopefully you know how to make extensions to the parser; see https://issues.apache.org/jira/browse/PHOENIX-1706 for instance. You can add an extension to INSERT syntax that is an empty string in Calcite's version of the parser, something else in your version of the parser. You might need to add a n