Skip to content

Conversation

@kumarUjjawal
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

  • dict_id is intentionally not preserved protobuf (it’s deprecated in Arrow schema metadata), but Arrow IPC still requires dict IDs for dictionary encoding/decoding.

What changes are included in this PR?

  • Fix protobuf serde for nested ScalarValue (list/struct/map) containing dictionary arrays by using Arrow IPC’s dictionary handling correctly.
  • Seed DictionaryTracker by encoding the schema before encoding the nested scalar batch.
  • On decode, reconstruct an IPC schema from the protobuf schema and use arrow_ipc::reader::read_dictionary to build dict_by_id before reading the record batch.

Are these changes tested?

Yes added a test for this

Are there any user-facing changes?

No

@github-actions github-actions bot added the proto Related to proto crate label Jan 29, 2026
@kumarUjjawal kumarUjjawal force-pushed the fix/dict_id_regression branch from af1a108 to e0a0061 Compare January 29, 2026 15:09
Copy link
Contributor

@brancz brancz left a comment

Choose a reason for hiding this comment

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

lgtm, thank you for fixing this!

@kumarUjjawal
Copy link
Contributor Author

lgtm, thank you for fixing this!

Thanks for the review!

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @kumarUjjawal

FYI @dispanser

@dispanser
Copy link

thanks @kumarUjjawal , appreciated!

root_as_message(encoded_schema.ipc_message.as_slice()).map_err(
|e| {
Error::General(format!(
"Error IPC schema message while deserializing ScalarValue::List: {e}"
Copy link
Member

Choose a reason for hiding this comment

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

Why the error messages say ScalarValue::List ? (List)
Isn't this used for any nested type ? List, Map, Struct, ...

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

Labels

proto Related to proto crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Physical plan proto roundtrip for null-valued scalar of a Struct(Dict) data type

5 participants