demo code: https://gist.github.com/drougon/af5dfa221511a07dc7d00454c4be796c
Or maybe extend the code in core/src/test/java/org/apache/calcite/sql/parser/parserextensiontesting/ to include validator extensions as well? -- Do you mean extend the generated code? parserextensiontesting directory contains ExtensionSqlParserTest/SqlCreateTable/SqlUploadJarNode. ------------------ Original ------------------ From: "Julian Hyde";<jh...@apache.org>; Send time: Wednesday, May 10, 2017 5:56 AM To: "dev"<dev@calcite.apache.org>; Subject: Re: How to implement custom sql dialect without modify calcite-core? I thought it was possible to create sub-classes or alternative implementations. You shouldn??t need to copy a lot of code. Can you share the code you??re trying to write? Or maybe extend the code in core/src/test/java/org/apache/calcite/sql/parser/parserextensiontesting/ to include validator extensions as well? > On May 8, 2017, at 9:01 PM, ?????? <ha...@qq.com> wrote: > > Hi everybody: > > > I want implement some custom features which shouldn't place in calcite-core > ,for example, add a special TableOverOpt grammar. I must modify the following > files: > 1. copy and modify core/src/main/codegen/templates/parser.jj > 2. add my own config.fmpp > 3. add SqlTableOverOpt.java/LogicalTableOverOpt.java to the calcite-core > 4. modify SqlToRelConverter.java SqlValidatorImpl in the calcite-core > 5. implement a PhysicalPlan like other adapters. > > > I found there is a way to implement CalcitePrepareImpl to avoid modify > calcite-core in step 3,4. but it looks I should copy a lot of codes in > org.apache.calcite.jdbc.* and org.apache.calcite.prepare.* > > > In the step 1,2 I can inject the parserFactory class in configs. > Is there any easy way to custom SqlToRelConverter SqlValidatorImpl and other > calcite components? > > > > Thanks in advance, hamsn