apache / apache/datafusion-java

Propagate Java stack traces from JVM upcalls into DataFusionError

Offen
#55 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
32
Forks
12
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Follow-up from PR #46 review ([thread](https://github.com/apache/datafusion-java/pull/46#discussion_r3255172936)).

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

- pgwhalen's session-configurable approach in his community binding: https://github.com/pgwhalen/datafusion-java/blob/1c20733aa8b008315af6092a912b58ef3df6a482/datafusion-ffi-java/src/main/java/org/apache/arrow/datafusion/config/ConfigOptions.java#L50-L54

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.