Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5791

DDL commands ceased to work in 1.23-1.24 transition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.24.0, 1.25.0, 1.26.0, 1.27.0, 1.28.0, 1.29.0, 1.30.0, 1.31.0, 1.32.0, 1.33.0, 1.34.0
    • None
    • server
    • None
    • OpenJDK 17 on Linux

    Description

      I'm interested in a self-contained prototype for UDF extensions, and looked at calcite-server for that purpose. The code snippet on https://calcite.apache.org/docs/adapter.html looked promising but does not run for me in the latest Git version despite adding the calcite-server JAR file to sqlline:

      Error: Error while executing SQL "CREATE TABLE testtable (counter int, content varchar(256))": Property 'org.apache.calcite.sql.parser.ddl.SqlDdlParserImpl#FACTORY' not
      valid as 'org.apache.calcite.sql.parser.ddl.SqlDdlParserImpl#FACTORY' not found in the classpath (state=,code=0)

      Inspired by ServerTest.java I played with the JDBC API myself and found that DDL works fine up to Calcite 1.23 but something must have broken it in more recent versions. The attached testcase makes this reproducible by changing the two JAR versions in pom.xml from 1.23 to e.g. 1.34, and rm -rf target. The error message with more recent versions is:

      Exception in thread "main" java.sql.SQLException: Error while executing SQL "create table t (i int not null)": DDL not supported: CREATE TABLE `T` (`I` INTEGER NOT NULL)

      (I also tried reproducing with sqlline from older Calcite releases from Git but they don't build anymore due to dependency errors. I guess the programmatic test case is good enough to demonstrate the issue.)

      Attachments

        1. testcases.csv
          0.1 kB
          Josef Spillner
        2. testcase-ddl.zip
          2 kB
          Josef Spillner
        3. autotest.sh
          0.3 kB
          Josef Spillner

        Activity

          People

            Unassigned Unassigned
            josefspillner Josef Spillner
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified