calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lai Yeong Wei <yw...@origineit.com>
Subject DML With JDBC Schame connected to MYSQL
Date Tue, 19 May 2015 10:31:50 GMT
Hi All,

Currently I am trying to execute DML (insert for this case) via Avatica.
With Calcite Model using the JdbcSchema$Factory that points to a MYSQL
datasource.

Upon the execution of,

    insert into "cognos"."dept" (deptno, dname, loc) values (50,
'DEVELOPMENT', 'MALAYSIA');

The error below is thrown, during the CheapestPlanReplacer#visit,

java.sql.SQLException: error while executing SQL "INSERT into
"cognos"."dept" (deptno, dname, loc) values (50, 'DEVELOPMENT',
'MALAYSIA')": Node [rel#6:Subset#1.ENUMERABLE.[]] could not be implemented;

(I am pasting just the error message, refer to the lower section for PLAN
dumped)

My first guess is that Calcite could not find an "implementor" for the
"1.ENUMERABLE" and with some code digging nothing seems to be fruitful.

I look forward for suggestion related to this attempt.

Thanks!

/------------------------------------------------------------------------------------------------------------------/

1. Model Content

public final static String jdbcModel =
      "inline:"
          + "{"
          +    "version: '1.0',"
          +    "defaultSchema: 'cognos',"
          +    "schemas: ["
          +    "{"
          +       "name: 'cognos',"
          +       "type: 'custom', "
          +       "factory:
'org.apache.calcite.adapter.jdbc.JdbcSchema$Factory',"
          +       "operand: {"
          +         "jdbcDriver: 'com.mysql.jdbc.Driver',"
          +         "jdbcUrl: 'jdbc:mysql://10.211.27.0/cognos',"
          +         "jdbcUser: 'root',"
          +         "jdbcPassword: 'skyline01'"
          +       "}"
          +    "}"
          +   "]"
          + "}";

2. PLAN Dumped

planner state:

Root: rel#6:Subset#1.ENUMERABLE.[]
Original rel:

Sets:
Set#0, type: RecordType(TINYINT DEPTNO, VARCHAR(14) DNAME, VARCHAR(13) LOC)
rel#2:Subset#0.NONE.[], best=null, importance=0.81
rel#0:LogicalValues.NONE.[[0, 1, 2], [1, 2], [2]](type=RecordType(TINYINT
DEPTNO, VARCHAR(14) DNAME, VARCHAR(13) LOC),tuples=[{ 50, 'DEVELOPMENT',
'MALAYSIA' }]), rowcount=1.0, cumulative cost={inf}
rel#10:Subset#0.ENUMERABLE.[], best=rel#9, importance=0.405
rel#9:EnumerableValues.ENUMERABLE.[[0, 1, 2], [1, 2],
[2]](type=RecordType(TINYINT DEPTNO, VARCHAR(14) DNAME, VARCHAR(13)
LOC),tuples=[{ 50, 'DEVELOPMENT', 'MALAYSIA' }]), rowcount=1.0, cumulative
cost={1.0 rows, 1.0 cpu, 0.0 io}
Set#1, type: RecordType(BIGINT ROWCOUNT)
rel#4:Subset#1.NONE.[], best=null, importance=0.9
rel#3:LogicalTableModify.NONE.[](input=rel#2:Subset#0.NONE.[],table=[cognos,
dept],operation=INSERT,updateColumnList=[],flattened=false), rowcount=1.0,
cumulative cost={inf}
rel#7:AbstractConverter.NONE.[](input=rel#6:Subset#1.ENUMERABLE.[],convention=NONE,sort=[]),
rowcount=1.0, cumulative cost={inf}
rel#6:Subset#1.ENUMERABLE.[], best=null, importance=1.0
rel#8:AbstractConverter.ENUMERABLE.[](input=rel#4:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message