felipepessoto commented on code in PR #13822:
URL: https://github.com/apache/gluten/pull/13822#discussion_r4747689422
##########
cpp/core/jni/JniError.h:
##########
@@ -53,6 +55,38 @@ class JniExceptionUnwrapperRegistration final {
ExceptionUnwrapper unwrap_;
};
+// A Java throwable to raise for a native error. className uses JNI's
slash-separated form and is resolved by
+// FindClass with the class loader of the class declaring the native method.
The class must extend
+// java.lang.Throwable and have a (byte[] reason, byte[] diagnostic)
constructor. The reason and diagnostic
+// should be UTF-8; their bytes, including NULs, are passed unchanged. The
strings are owned, so the JNI
+// boundary uses no backend memory.
+struct JniExceptionMetadata {
+ std::string className;
Review Comment:
Thanks, agreed. Done in 39c3d9f05 (d6242d787 only clarifies comments and
docs). The provider now returns only data: the backend's name for the function
that failed, a reason and a diagnostic. The JNI boundary always raises a
`GlutenNativeException` carrying them, and the Java code that catches it, such
as an iterator's `translateException`, chooses the exception users see.
Backends no longer name any Java class, and the core resolves
`GlutenNativeException` and its constructor when the library loads, not when an
error occurs. #13135 builds on this: its Velox provider reports `cast`, and its
Java side maps that to Spark's cast exceptions. Does this match what you had in
mind?
<sub>Auto-replied by the [GitHub Copilot app](https://gh.io/app)</sub>
--
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]