vvysotskyi commented on a change in pull request #1714: DRILL-7048: Implement 
JDBC Statement.setMaxRows() with System Option
URL: https://github.com/apache/drill/pull/1714#discussion_r269027601
 
 

 ##########
 File path: 
exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillPreparedStatementImpl.java
 ##########
 @@ -259,4 +261,17 @@ public void setObject(int parameterIndex, Object x, 
SQLType targetSqlType) throw
     checkOpen();
     super.setObject(parameterIndex, x, targetSqlType);
   }
+
+  @Override
+  public void setLargeMaxRows(long maxRowCount) throws SQLException {
+    Statement setMaxStmt = this.connection.createStatement();
+    setMaxStmt.execute("ALTER SESSION SET `" + ExecConstants.QUERY_MAX_ROWS + 
"`=" + maxRowCount);
+    setMaxStmt.close();
+    this.maxRowCount = maxRowCount;
 
 Review comment:
   Please remove this line and put into the beginning of the method call 
`super.setLargeMaxRows(maxRowCount)`, so it will check that connection is open 
and validate `maxRowCount` value.
   
   The same for changes in `DrillStatementImpl`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services

Reply via email to