[ 
https://issues.apache.org/jira/browse/CALCITE-5791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17736050#comment-17736050
 ] 

Josef Spillner commented on CALCITE-5791:
-----------------------------------------

Thank you so much Mihai and Julian for your rapid commenting. Looking at the 
Jira overflow, this is really appreciated. I will debug this further in the 
next days and leave the issue open for now. Mihai, indeed my longer-term goal 
would be to get DDL going without JDBC to get access to underlying cost metrics 
etc., and have not been aware of the possibility of casting of the sqlNodes so 
far. Will take a look at leveraging some of your code, and yet in parallel try 
to establish a successful baseline with JDBC because (1) it used to work and 
(2) the docs say it should work.

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

Reply via email to