You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Mihai Budiu (Jira)" <ji...@apache.org> on 2023/06/21 17:03:00 UTC
[jira] [Commented] (CALCITE-5791) DDL commands ceased to work in 1.23-1.24 transition
[ https://issues.apache.org/jira/browse/CALCITE-5791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17735822#comment-17735822 ]
Mihai Budiu commented on CALCITE-5791:
--------------------------------------
Our project has been using DDL recently with no problems using the current Calcite distribution. Here is an example file setting up the Calcite DDL parser explicitly:
https://github.com/feldera/dbsp/blob/334a6ac29cb6185f808cdd294c9c7a33c5e6f375/sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/calciteCompiler/CalciteCompiler.java
(A couple of weeks ago we have switched to a custom parser that combines DDL and Babel, so this is an older snapshot.)
> DDL commands ceased to work in 1.23-1.24 transition
> ---------------------------------------------------
>
> Key: CALCITE-5791
> URL: https://issues.apache.org/jira/browse/CALCITE-5791
> Project: Calcite
> Issue Type: Bug
> Components: server
> Affects Versions: 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
> Environment: OpenJDK 17 on Linux
> Reporter: Josef Spillner
> Priority: Minor
> Labels: newbie
> Fix For: 1.23.0
>
> Attachments: testcase-ddl.zip
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> 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:
> _{color:#000000}Error: Error while executing SQL {color}{color:#ff54ff}"CREATE TABLE testtable (counter int, content varchar(256))"{color}{color:#000000}: Property {color}{color:#ff54ff}'org.apache.calcite.sql.parser.ddl.SqlDdlParserImpl#FACTORY'{color}{color:#000000} not{color}_
> _valid as {color:#ff54ff}'org.apache.calcite.sql.parser.ddl.SqlDdlParserImpl#FACTORY'{color}{color:#000000} not found in the classpath (state=,code=0){color}_
> 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:
> _{color:#000000}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){color}_
> (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.)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)