zhztheplayer commented on code in PR #10034:
URL:
https://github.com/apache/incubator-gluten/pull/10034#discussion_r2162931682
##########
gluten-flink/runtime/src/main/java/org/apache/gluten/table/runtime/operators/GlutenSourceFunction.java:
##########
@@ -97,11 +97,16 @@ public void run(SourceContext<RowData> sourceContext)
throws Exception {
UpIterator.State state = task.advance();
if (state == UpIterator.State.AVAILABLE) {
final RowVector outRv = task.get();
- List<RowData> rows = FlinkRowToVLVectorConvertor.toRowData(outRv,
allocator, outputType);
- for (RowData row : rows) {
- sourceContext.collect(row);
+ try {
+ List<RowData> rows = FlinkRowToVLVectorConvertor.toRowData(outRv,
allocator, outputType);
+ for (RowData row : rows) {
+ sourceContext.collect(row);
+ }
+ } finally {
+ if (outRv != null) {
+ outRv.close();
+ }
Review Comment:
nit: When will `outRv != null`?
##########
gluten-flink/runtime/src/main/java/org/apache/gluten/table/runtime/operators/GlutenSourceFunction.java:
##########
@@ -97,11 +97,16 @@ public void run(SourceContext<RowData> sourceContext)
throws Exception {
UpIterator.State state = task.advance();
if (state == UpIterator.State.AVAILABLE) {
final RowVector outRv = task.get();
- List<RowData> rows = FlinkRowToVLVectorConvertor.toRowData(outRv,
allocator, outputType);
- for (RowData row : rows) {
- sourceContext.collect(row);
+ try {
+ List<RowData> rows = FlinkRowToVLVectorConvertor.toRowData(outRv,
allocator, outputType);
+ for (RowData row : rows) {
+ sourceContext.collect(row);
+ }
+ } finally {
+ if (outRv != null) {
+ outRv.close();
+ }
Review Comment:
nit: When will `outRv == null`?
--
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]