lidavidm commented on code in PR #34227:
URL: https://github.com/apache/arrow/pull/34227#discussion_r1204311153


##########
java/dataset/src/main/java/org/apache/arrow/dataset/substrait/AceroSubstraitConsumer.java:
##########
@@ -96,15 +96,17 @@ private ArrowReader execute(String plan, Map<String, 
ArrowReader> namedTables) t
         ArrowArrayStream streamOutput = 
ArrowArrayStream.allocateNew(this.allocator)
     ) {
       String[] mapTableToMemoryAddress = 
getMapTableToMemoryAddress(namedTables, arrowArrayStream);
-      JniWrapper.get().executeSerializedPlanNamedTables(
+      JniWrapper.get().executeSerializedPlan(
           plan,
           mapTableToMemoryAddress,
           streamOutput.memoryAddress()
       );
       return Data.importArrayStream(this.allocator, streamOutput);
     } finally {
-      for (ArrowArrayStream stream : arrowArrayStream) {
-        stream.close();
+      try {
+        AutoCloseables.close(arrowArrayStream);
+      } catch (Exception e) {
+        throw new RuntimeException(e);

Review Comment:
   Why are we catching it in the first place? Let it propagate.



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

Reply via email to