nielsbasjes edited a comment on pull request #12962:
URL: https://github.com/apache/beam/pull/12962#issuecomment-739500944


   I am in need of advice / assistance.
   
   What I ran into is that some tests in the current state of this pull request 
fail over a change in Calcite.
   I am specifically talking about 
https://github.com/apache/beam/blob/master/sdks/java/extensions/sql/jdbc/src/test/java/org/apache/beam/sdk/extensions/sql/jdbc/BeamSqlLineTest.java#L63
 and many other tests in this file that do a `CREATE EXTERNAL TABLE` or a `DROP 
TABLE`.
   
   I tracked the source of this exception back to Calcite where a few months 
ago this default method was added in Calcite by @julianhyde : 
https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql/parser/SqlParserImplFactory.java#L58
   
   This default implementation simply returns a `DdlExecutor` (a new interface) 
that always fails with a `UnsupportedOperationException` if no valid 
implementation has been provided.
   Looks good so far.
   
   The problem I have is that my knowledge is lacking how to correctly override 
this method to return the implementation for Beam that makes it possible to do 
a `CREATE EXTERNAL TABLE`.
   
   A pointer on how I should fix this correctly is highly appreciated.
   
   ----
   
   I found in the generated code of BeamSqlParserImpl this code (I shortened it 
a bit)
   ```
       public static final SqlParserImplFactory FACTORY = new 
SqlParserImplFactory() {
           public SqlAbstractParserImpl getParser(Reader reader) {
               final BeamSqlParserImpl parser = new BeamSqlParserImpl(reader);
   ...
               return parser;
           }
       };
   ```
   which is generated from a template in Calcite itself and (as far as I have 
been able to find so far) does not have a way of implementing a non-default 
method for `DdlExecutor getDdlExecutor()`.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to