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

YeongWei commented on CALCITE-705:
----------------------------------

Hi [~julianhyde],

I am attempting to resolve the return boolean value for the 
AvaticaStatement#execute method.

However from CalcitePrepareImpl#prepare2_, there is a CASE STATEMENT which 
evaluates with SqlNode#getKind then create the appropriate RelDataType Object. 
For the case of INSERT, DELETE, UPDATE and EXPLAIN, all will invoke the 
RelOptUtil#createDmlRowType which creates a single element list consisting a 
Pair identified with ROWCOUNT.

Therefore upon DML execution, the above gets bubbled up as a ResultSet having 
one column (ROWCOUNT) with one row (ROWCOUNT's value).

>From JDBC perspective, when user executes the statement#execute("INSERT INTO 
>test values (1, 'ABC')") the result should return the boolean false since the 
>DML does not expect ResultSet.

However currently a ResultSet with column "ROWCOUNT" is returned causing the 
statement#execute to return true. Which does not follow the JDBC standard.

Can you shed some on around this matter? As DML should cause the 
statement#execute to return false.

Thanks!

> AvaticaStatement execute method to support DML
> ----------------------------------------------
>
>                 Key: CALCITE-705
>                 URL: https://issues.apache.org/jira/browse/CALCITE-705
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: YeongWei
>            Assignee: Julian Hyde
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to