3

I am trying to find if there are any guidelines published for what needs to be extended in order to support say something as basic as transactions with Calcite? Unable to find anything meaningful in the documentation so far.

This is the only reference I found when I looked for "calcite transactions not working". https://mail-archives.apache.org/mod_mbox/calcite-dev/201502.mbox/%3CCAMCtme+wSQq8eHzapYC9-3STzpB7D5AyxY0Aa7pzbyUCJnHD6A@mail.gmail.com%3E

I am working on writing a custom adapter since we needed finer control on both read/write pipelines. I.e. we want the adapter to be an interface for applications that until now worked with conventional RDBMS; which means support all the SQL constructs but also provides us with the capabilities that calcite enables. To exercise this, I have a simple data loader that can connect to any rdbms system & load the data into our back end. The loader is using Avatica implementations of java.sql APIs for DDL/DML & queries.

Since CalciteMetaImpl commit is explicitly throwing exceptions, its not possible to do something like...

Connection conn = ...
conn.setAutoCommit(false);
try{
    PreparedStatement prep_stmt = conn.prepareStatement(sql.toString());

    while(...){
      //set values..
      prep_stmt.addBatch()/prep_stmt.executeBatch();
    }
}
conn.commit();//or abort

What can be helpful is either some sample implementation that demonstrates this or some guidelines about how this can be achieved.

0 Answers0