harikrishna553 opened a new issue, #19918:
URL: https://github.com/apache/druid/issues/19918

   # Druid Avatica JDBC driver does not honor `Statement.setMaxRows()`
   
   ## Description
   
   The Druid JDBC driver does not appear to honor the JDBC 
`Statement.setMaxRows(int)` setting.
   
   According to the JDBC API, `setMaxRows()` specifies the maximum number of 
rows that a `Statement` should return. However, when using the Druid Avatica 
JDBC driver, setting `maxRows` does not limit the number of rows returned in 
the `ResultSet`.
   
   ## Steps to reproduce
   
   1. Connect to Druid using the Avatica JDBC driver.
   2. Create a `PreparedStatement`.
   3. Set `setMaxRows(5)`.
   4. Execute a query that returns more than 5 rows.
   5. Iterate over the `ResultSet`.
   
   Sample Code Snippet
   ```java
   try (Connection connection = dataSource.getConnection();
        PreparedStatement preparedStatement = 
connection.prepareStatement(sqlQuery)) {
   
       preparedStatement.setMaxRows(maxRecordsToReturn);
   
       try (ResultSet resultSet = preparedStatement.executeQuery()) {
           //......
       }
   }
   ```
   
   Version Used
   ```xml
   <dependency>
       <groupId>org.apache.calcite.avatica</groupId>
       <artifactId>avatica-core</artifactId>
       <version>1.28.0</version>
   </dependency>
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to