Moccy.T created CALCITE-5972:
--------------------------------

             Summary: cannot execute a sql like 'insert into A select * from B'
                 Key: CALCITE-5972
                 URL: https://issues.apache.org/jira/browse/CALCITE-5972
             Project: Calcite
          Issue Type: Bug
         Environment: calcite :1.35.0
            Reporter: Moccy.T


I have put the
{code:java}
org.apache.calcite.adapter.csv.CsvScannableTable{code}
and its related classes (Factory, Reader......, etc.) into my test project.
When I tried to execute a sql like
{code:java}
insert into mysql.calcite_test (select * from csv) {code}
an NPE was thrown. where `mysql` is recognised by JdbcSchema#Factory. When I 
debugged, I found that the bind method of the dynamically generated Bindable 
code called the JdbcTable's getModifiableCollection() method, which returned 
null directly. the bind method's subsequent call to collection.size() threw an 
NPE. this code is identified by the This code is generated by 
EnumerableTableModify.class.
After that, I tried to execute 
{code:java}
insert into mysql.calcite(select * from mysql2.calcite2){code}
There are two JdbcSchema#Factory recognised data sources here, but I found that 
the code that was eventually generated by JdbcToEnumerableConverter.class 
executed
{code:java}
insert into calcite(select * from mysql2.calcite){code}
in `mysql2` without performing the insert in the `mysql` library.
Are these issues intentional with calcite or are they bugs?

 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to