You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Spark] Keep the writer's two Spark type dispatchers in sync, and clean up if construction fails #13
Since PR #7, the writer dispatches on Spark type in two places:
SparkToArrowSchema, which builds the Arrow schema;
ArrowFieldWriter.create, which builds the per-column writers.
Nothing keeps the two in sync.
Why it matters
The constructor only catches IOException, and ArrowFieldWriter.create runs after the native writer has opened the output file.
Suppose a type is added to SparkToArrowSchema but not to ArrowFieldWriter, or the vector classes don't line up. Then create throws IllegalArgumentException or ClassCastException out of the constructor. Spark never gets a DataWriter to abort, so the native writer, its open file, the RootAllocator and the VectorSchemaRoot all leak.
Impact
Latent. Both dispatchers cover the same types today, and an unsupported type throws in SparkToArrowSchema.convert, before the native writer is opened.
PR #35 supersedes #22 as the fix for this issue. Its FileFormat writer creates the Arrow field writers before opening the native writer and catches RuntimeException during initialization to release the resources already allocated. PR #35 now includes the closing reference. This issue remains open until #35 merges.
Activity
ChristopherWirt commentedon Nov 2, 2026
PR #35 supersedes #22 as the fix for this issue. Its FileFormat writer creates the Arrow field writers before opening the native writer and catches RuntimeException during initialization to release the resources already allocated. PR #35 now includes the closing reference. This issue remains open until #35 merges.