Skip to content

GH-50596: [C++] AppendScalar implementation uses polymorphism#50652

Open
KHARSHAVARDHAN-eng wants to merge 2 commits into
apache:mainfrom
KHARSHAVARDHAN-eng:gh-50596-append-scalar-polymorphism
Open

GH-50596: [C++] AppendScalar implementation uses polymorphism#50652
KHARSHAVARDHAN-eng wants to merge 2 commits into
apache:mainfrom
KHARSHAVARDHAN-eng:gh-50596-append-scalar-polymorphism

Conversation

@KHARSHAVARDHAN-eng

@KHARSHAVARDHAN-eng KHARSHAVARDHAN-eng commented Jul 27, 2026

Copy link
Copy Markdown

Summary

ArrayBuilder::AppendScalar and AppendScalars previously relied on the
centralized AppendScalarImpl visitor to dispatch scalar appends based on
the scalar type.

This refactors scalar appending to use virtual method polymorphism within
the builder hierarchy, moving the implementation into the appropriate
builder classes while preserving the existing behavior.

Implementation

  • Remove the centralized AppendScalarImpl visitor.
  • Implement AppendScalar and AppendScalars on the relevant builder
    classes.
  • Retain the existing dispatch semantics while replacing visitor-based
    dispatch with virtual method polymorphism.

Testing

  • Built arrow-array-test.
  • Ran the full arrow-array-test suite.
  • All 1047 tests passed.

Replace the centralized AppendScalarImpl visitor with virtual
AppendScalar and AppendScalars overrides on builder classes.

This moves scalar append logic into the appropriate builder hierarchy,
removing the need for runtime dispatch through AppendScalarImpl while
preserving existing behavior.
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #50596 has been automatically assigned in GitHub to PR creator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant