Skip to content

refactor: use REE field name constants across crates - #11064

Open
akashchamp wants to merge 2 commits into
apache:mainfrom
akashchamp:issue-11035-use-ree-field-constants
Open

akashchamp wants to merge 2 commits into
apache:mainfrom
akashchamp:issue-11035-use-ree-field-constants

Conversation

@akashchamp

@akashchamp akashchamp commented Sep 12, 2026

Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

Field::REE_RUN_ENDS_FIELD_DEFAULT_NAME and Field::REE_VALUES_FIELD_DEFAULT_NAME already exist in arrow-schema, but the default run_ends / values child names were still spelled out as string literals across the workspace. Using the constants everywhere keeps the default names in one place, in the same way #10517 did for the map field names.

What changes are included in this PR?

Replace every default run-end encoded child field name literal with the shared constants, keeping behaviour identical:

  • arrow-schema: display, parse, ffi, fields and canonical extension code and tests
  • arrow-array: RunArray::try_new (the default names every RunArray gets) and new_null_array tests
  • arrow-data: run transform and validation tests
  • arrow-cast, arrow-ord, arrow-row, arrow-select (no REE literals there), arrow-ipc, arrow-json, arrow-avro (codec, schema and writer round-trip test), arrow-integration-test (JSON runendencoded placeholder type), arrow (data_gen and the cast benchmarks), parquet (arrow_writer bench) and parquet-variant-compute tests

Intentional custom-name cases (for example the named_values display/parse tests) and unrelated "values" field names (dictionary values in arrow-flight, map value fallback in arrow-avro, plain column names in arrow-ipc tests) are left as literals on purpose.

Are these changes tested?

Covered by the existing tests; no behaviour changes. Run locally:

  • cargo fmt --all -- --check
  • cargo test --lib for arrow-data, arrow-array, arrow-ord, arrow-row, arrow-ipc, arrow-json, arrow-cast, arrow-avro, arrow-integration-test, arrow (with test_utils) and parquet-variant-compute
  • cargo check for the touched arrow, arrow-json and parquet benchmarks
  • cargo clippy --all-targets --all-features -- -D warnings on the touched crates

Are there any user-facing changes?

None.

AI assistance was used to identify and apply the mechanical substitutions across crates. I reviewed every changed construction and confirmed that custom-name cases and unrelated "values" field names remain explicit literals.

Replace default run-end encoded field-name literals with the shared constants.
@github-actions github-actions Bot added arrow Changes to the arrow crate arrow-schema labels Sep 12, 2026

@Rich-T-kid Rich-T-kid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems straightforward, thank you @akashchamp

@Jefffrey

Copy link
Copy Markdown
Contributor

i think we should aim to rewire to more crates than just arrow-schema, like how maps was done

Rewire the default run-end encoded child field names in the other
workspace crates to Field::REE_RUN_ENDS_FIELD_DEFAULT_NAME and
Field::REE_VALUES_FIELD_DEFAULT_NAME, following the approach used for
the map field names in apache#10517: arrow-array (RunArray::try_new),
arrow-data, arrow-cast, arrow-ord, arrow-row, arrow-ipc, arrow-json,
arrow-avro, arrow-integration-test, arrow, parquet and
parquet-variant-compute.

Custom-name cases and unrelated "values" field names (dictionary values
in arrow-flight, map value fallback in arrow-avro, plain column names in
arrow-ipc tests) are intentionally left as literals. No behaviour
change.
@akashchamp akashchamp changed the title refactor(schema): use REE field name constants refactor: use REE field name constants across crates Sep 20, 2026
@akashchamp

Copy link
Copy Markdown
Author

Good call, thanks for the pointer to #10517. I have now rewired the rest of the workspace the same way: arrow-array (RunArray::try_new), arrow-data, arrow-cast, arrow-ord, arrow-row, arrow-ipc, arrow-json, arrow-avro, arrow-integration-test, arrow, parquet and parquet-variant-compute all use Field::REE_RUN_ENDS_FIELD_DEFAULT_NAME / Field::REE_VALUES_FIELD_DEFAULT_NAME, so no default run_ends/values literals remain outside the constant definitions. arrow-select and arrow-flight had no REE name literals to change, and the remaining "values" literals are dictionary, map or ordinary column fields, not REE children, so I left them as they are.

@Rich-T-kid Rich-T-kid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good, nice suggestion Jefffrey

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

Labels

arrow Changes to the arrow crate arrow-schema

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire REE field name constants to more usages in arrow-schema

3 participants