Skip to content

Propagate Java stack traces from JVM upcalls into DataFusionError #55

@andygrove

Description

@andygrove

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions