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

ASF GitHub Bot commented on DRILL-6834:
---------------------------------------

KazydubB commented on a change in pull request #1549: DRILL-6834: Introduce 
option to disable result set on CTAS, create vi…
URL: https://github.com/apache/drill/pull/1549#discussion_r235770618
 
 

 ##########
 File path: exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillCursor.java
 ##########
 @@ -499,6 +500,13 @@ private boolean nextRowInternally() throws SQLException {
 
           currentRecordNumber = 0;
 
+          if (qrb.getHeader().hasUpdateCount()) {
+            int updateCount = qrb.getHeader().getUpdateCount();
+            int currentUpdateCount = statement.getUpdateCount() == -1 ? 0 : 
statement.getUpdateCount();
+            ((DrillStatement) statement).setUpdateCount(updateCount + 
currentUpdateCount);
 
 Review comment:
   Unfortunately not, because `ResultSet` is set before actual data is queried 
([AvaticaConnection](https://github.com/apache/calcite-avatica/blob/master/core/src/main/java/org/apache/calcite/avatica/AvaticaConnection.java#L660)).
   However, `DrillStatement#setResultSet(AvaticaResultSet)` may be removed and 
`openResultSet` (see DrillStatementImpl below) can be nullified when update 
count is set with `#setUpdateCount(int)` method.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Introduce option to disable result set on CTAS, create view and drop 
> table/view etc. for JDBC connection
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-6834
>                 URL: https://issues.apache.org/jira/browse/DRILL-6834
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Bohdan Kazydub
>            Assignee: Bohdan Kazydub
>            Priority: Major
>              Labels: doc-impacting
>             Fix For: 1.15.0
>
>
> There are some tools (Unica, dBeaver, TalenD) that do not expect to obtain 
> result set on CTAS query. As a result the query gets canceled. Hive, on the 
> other hand, does not return result set for the query and these tools work 
> well.
> To improve Drill's integration with such tools a session option 
> {{`drill.exec.fetch_resultset_for_ddl`}} is introduced. If the option is 
> enabled (set to `true`) Drill's behaviour will be unchanged, i.e. all result 
> set will be returned for all queries. If the option is disabled (set to 
> `false`), CTAS, CREATE VIEW, CREATE FUNCTION, DROP TABLE, DROP VIEW, DROP 
> FUNCTION, USE schema, SET option, REFRESH METADATA TABLE etc. queries will 
> not return result set but {{updateCount}} instead.
> The option affects JDBC connections only.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to