pan3793 commented on code in PR #5134:
URL: https://github.com/apache/kyuubi/pull/5134#discussion_r1302878165
##########
externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/FlinkOperation.scala:
##########
@@ -98,25 +105,42 @@ abstract class FlinkOperation(session: Session) extends
AbstractOperation(sessio
assertState(OperationState.FINISHED)
setHasResultSet(true)
order match {
- case FETCH_NEXT => resultSet.getData.fetchNext()
case FETCH_PRIOR => resultSet.getData.fetchPrior(rowSetSize);
case FETCH_FIRST => resultSet.getData.fetchAbsolute(0);
+ case FETCH_NEXT => // ignored because new data are fetched lazily
+ }
+ val batch = new ListBuffer[Row]
+ try {
+ // there could be null values at the end of the batch
+ // because Flink could return an EOS
+ var rows = 0
+ while (resultSet.getData.hasNext && rows < rowSetSize) {
+ Option(resultSet.getData.next()).foreach(r => { batch += r; rows += 1
})
Review Comment:
```suggestion
Option(resultSet.getData.next()).foreach { r => batch += r; rows +=
1 }
```
--
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]