waterWang opened a new pull request, #19946:
URL: https://github.com/apache/druid/pull/19946

   ### Problem
   
   `Statement.setMaxRows()` was ignored for ordinary JDBC Statements because 
`DruidJdbcStatement.execute()` hardcoded `Long.MAX_VALUE` instead of forwarding 
the `maxRowCount` parameter. Additionally, `ResultFetcher` only marked a frame 
complete when the underlying yielder was exhausted, so reaching the row limit 
produced empty non-terminal frames indefinitely.
   
   See [issue #19918](https://github.com/apache/druid/issues/19918) for the 
full analysis.
   
   ### Changes
   
   1. **DruidJdbcStatement**: pass `maxRowCount` through to 
`DruidJdbcResultSet` instead of `Long.MAX_VALUE`
   2. **DruidJdbcResultSet.ResultFetcher**: mark frame `done` when the row 
limit is reached (`offset >= limit`), not only when the yielder is exhausted
   3. **Tests**: added `testMaxRowCountDirect` (single frame) and 
`testMaxRowCountOverMultipleFramesDirect` (cross-frame limit)
   
   ### Key insight
   
   The `maxRowCount` was already correctly threaded through the 
PreparedStatement path (`DruidJdbcPreparedStatement`). The bug was specific to 
the ordinary Statement path (`DruidJdbcStatement.execute()`).
   
   Fixes #19918


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