Skip to content

refactor(spark): make ArrowFieldWriter generic over its vector - #17

Merged
ChristopherWirt merged 1 commit into
developfrom
rasheed/spark-arrow-field-writer-tidy
Nov 2, 2026
Merged

ChristopherWirt merged 1 commit into
developfrom
rasheed/spark-arrow-field-writer-tidy

Conversation

@gitRasheed

Copy link
Copy Markdown
Collaborator

Summary

Fixes #14

Two structural tidy-ups in ArrowFieldWriter. No behaviour change.

Changes

  • ArrowFieldWriter<V extends FieldVector> holds the vector as final V vector. The 16 subclasses drop their typed copy of it (bits, bytes, shorts, ...) and the constructors that only set it. create returns ArrowFieldWriter<?>.
  • count advances only in the base class. writeNull() appends a null and advances count, and StructWriter.setNull calls it for each child instead of incrementing the children's count by hand.

Testing

Existing tests cover it. VortexNestedSchemaPruningTest writes null structs with struct children, and one of its cases fails if writeNull() doesn't advance count.

Checked locally: ./gradlew --parallel --continue javadoc check, and :vortex-spark_2.13:test -PsparkTestVersion=4.2.0.

I used AI tools to help write and review this change.

Each writer kept a typed copy of the base vector field. Hold it as
`final V vector` instead, and advance `count` only in the base class:
a null struct's children now get `writeNull()` rather than having their
`count` bumped by hand.

Signed-off-by: gitRasheed <[email protected]>
@ChristopherWirt
ChristopherWirt merged commit 85d8c8a into develop Nov 2, 2026
1 check passed
ChristopherWirt added a commit that referenced this pull request Nov 2, 2026
Preserve the generic Arrow field writers from #17 and exception-safe schema cleanup and regression coverage from #18 alongside independent JNI buffer ownership.

Signed-off-by: Christopher Wirt <[email protected]>
gitRasheed added a commit that referenced this pull request Nov 2, 2026
Develop changed old-connector files that this branch removes (#17) and
the JNI writer files this branch already carries with the new writer port
(#18, #49). The resolution keeps this branch's versions and takes the
broader schema release test from #18.

Signed-off-by: gitRasheed <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Spark] Tidy ArrowFieldWriter: generic vector field and a single place that advances count

2 participants