Follow-up from PR #46 review (thread).
Problem
When a Java-implemented upcall throws (currently: scalar UDFs via JniBridge, but the same will apply to any future upcall — table providers, aggregate UDFs, etc.), the native side surfaces only the exception class name and getMessage() via DataFusionError::Execution. The Java stack trace is discarded, which makes debugging much harder than necessary.
Proposal
Capture the throwable's stack trace on the JVM side and include it in the error string returned to native code. Make verbosity configurable per SessionContext so production callers can opt out — e.g. an enum like message | full | none, default full.
Scope
Should cover all JVM→native upcall paths, not just scalar UDFs. A shared helper in org.apache.datafusion.internal.JniBridge (or a new JniErrors utility) that converts a Throwable to the configured representation, used wherever upcalls catch exceptions.
References
Follow-up from PR #46 review (thread).
Problem
When a Java-implemented upcall throws (currently: scalar UDFs via
JniBridge, but the same will apply to any future upcall — table providers, aggregate UDFs, etc.), the native side surfaces only the exception class name andgetMessage()viaDataFusionError::Execution. The Java stack trace is discarded, which makes debugging much harder than necessary.Proposal
Capture the throwable's stack trace on the JVM side and include it in the error string returned to native code. Make verbosity configurable per
SessionContextso production callers can opt out — e.g. an enum likemessage | full | none, defaultfull.Scope
Should cover all JVM→native upcall paths, not just scalar UDFs. A shared helper in
org.apache.datafusion.internal.JniBridge(or a newJniErrorsutility) that converts aThrowableto the configured representation, used wherever upcalls catch exceptions.References