Skip to content

GH-51779: [C++][IPC] Read a DictionaryEncoding without indexType as int32 indices - #51807

Open
CaptainAni187 wants to merge 1 commit into
apache:mainfrom
CaptainAni187:GH-51779-default-dictionary-index-type
Open

CaptainAni187 wants to merge 1 commit into
apache:mainfrom
CaptainAni187:GH-51779-default-dictionary-index-type

Conversation

@CaptainAni187

@CaptainAni187 CaptainAni187 commented Oct 5, 2026 •

Copy link
Copy Markdown

Rationale for this change

Schema.fbs allows DictionaryEncoding.indexType to be omitted: "If this field is null, the indices must be signed int32." The C++ IPC reader required it instead, so C++ and PyArrow failed to read such a stream with IOError: Unexpected null field DictionaryEncoding.indexType in flatbuffer-encoded metadata.

What changes are included in this PR?

FieldFromFlatbuffer uses int32() as the index type when indexType is absent, instead of failing the null check.

Are these changes tested?

Yes. TestMessageInternal.DictionaryEncodingWithoutIndexType builds a schema message whose dictionary-encoded field has no indexType and checks that ReadSchema returns dictionary<values=string, indices=int32>. On main it fails with the error above. The arrow-ipc-* tests pass locally.

Are there any user-facing changes?

Streams that omit indexType can now be read. Streams that include it are read as before.

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

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

@CaptainAni187
CaptainAni187 marked this pull request as ready for review October 5, 2026 23:54
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