zhztheplayer commented on code in PR #13561:
URL: https://github.com/apache/gluten/pull/13561#discussion_r4684115245
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -451,32 +451,36 @@ JNIEXPORT jboolean JNICALL
Java_org_apache_gluten_vectorized_ColumnarBatchOutIte
JNIEnv* env,
jobject wrapper,
jlong iterHandle) {
+ const Runtime* outputRuntime = nullptr;
JNI_METHOD_START
auto iter = ObjectStore::retrieve<ResultIterator>(iterHandle);
if (iter == nullptr) {
std::string errorMessage =
"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);
}
+ outputRuntime = iter->runtime();
return iter->hasNext();
- JNI_METHOD_END(false)
+ JNI_METHOD_END_WITH_RUNTIME(false, outputRuntime)
Review Comment:
Can we add a new registry for unwrapping exceptions, besides the code
https://github.com/apache/gluten/blob/c9290620365b6ca94edb5669c880734028d5d09b/cpp/velox/compute/VeloxBackend.cc#L163-L166,
assuming it's a piece of static code that doesn't have to be placed in the
runtime API.
Then see if we can keep `JNI_METHOD_END(false)` but call the polymorphic
implementation in the macro
--
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]