felipepessoto commented on code in PR #13561:
URL: https://github.com/apache/gluten/pull/13561#discussion_r4671490449


##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -458,7 +458,7 @@ JNIEXPORT jboolean JNICALL 
Java_org_apache_gluten_vectorized_ColumnarBatchOutIte
         "When hasNext() is called on a closed iterator, an exception is 
thrown. To prevent this, consider using the protectInvocationFlow() method when 
creating the iterator in scala side. This will allow the hasNext() method to be 
called multiple times without issue.";
     throw GlutenException(errorMessage);
   }
-  return iter->hasNext();
+  return readJniOutputIterator(*iter, &ResultIterator::hasNext);

Review Comment:
   Yes. In 03154ca4a I removed the `try`/`catch` around the iterator reads. 
`JNI_METHOD_END` and its runtime-aware form now share one catch and one 
fallback. Only `nativeHasNext` and `nativeNext` opt into the Velox lookup: on 
failure, Velox returns the captured Java exception instead of rethrowing it. If 
a Java exception is already pending, the shared handler leaves it alone without 
calling Velox.



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