Hi,

I'm trying to update the version of Calcite used in Beam to the latest
version available.
https://issues.apache.org/jira/browse/BEAM-9379
https://github.com/apache/beam/pull/12962

I've hit a bit of a roadblock that I'm asking your help for.

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.e. do DDL stuff).

I tracked the source of this exception back to Calcite where a few months
ago a DdlExecutor was added and this default method for `DdlExecutor
getDdlExecutor()` was added in Calcite:
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.
This is marked as experimental and looks good to me so far.

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().

How do we fix this?
or ... can we fix this in Beam or is actually a change in Calcite needed?

-- 
Best regards / Met vriendelijke groeten,

Niels Basjes

Reply via email to