Skip to content

Conversation

@drin
Copy link
Contributor

@drin drin commented Oct 20, 2025

Which issue does this PR close?

This also addresses #18122 but for branch-48 of datafusion

Rationale for this change

The PR #18187 addresses the fix on main, but for compatibility with iceberg-rust, we also want this fix available for branch-48.

For any other information, please see #18187, which has quite a bit of information.

drin added 3 commits October 20, 2025 15:49
This fixes a semantic error when reading a logical plan from protobuf.
Existing behavior is to use the `relation` field of `ColumnRelation`
message to construct a `TableReference`. However, the `relation` field
is a string and `From<String> for TableReference` always calls
parse_identifiers_normalized with `ignore_case: False`, which always
normalizes the identifier to lower case.
New behavior is to implement `From<protobuf::ColumnRelation> for
TableReference` which calls a new method, `parse_str_normalized`, with
`ignore_case: True`.

Overall, if normalization occurs, it should happen prior to
serialization to protobuf; thus, deserialization from protobuf should
not normalize (if it is desirable, though, `parse_str_normalized`
propagates its boolean parameter to `parse_identifiers_normalized`
unlike `parse_str`).

Issue: apache#18122
A new test case, `roundtrip_mixed_case_table_reference`, exercises a
scenario where a logical plan containing a table reference with
uppercase characters is roundtripped through protobuf and the
deserialization side erroneously normalizes the table reference to
lowercase.

Issue: apache#18122
For parse_identifiers_normalized, the `ignore_case` parameter controls
whether the parsing should be case-sensitive (ignore_case: true) or
insensitive (ignore_case: false). The name of the parameter is
counter-intuitive to the behavior, so this adds a clarifying comment for
the method.
@github-actions github-actions bot added common Related to common crate proto Related to proto crate labels Oct 20, 2025
@drin
Copy link
Contributor Author

drin commented Oct 21, 2025

Closing as we apparently don't need the backport, feel free to reopen if someone wants it

@drin drin closed this Oct 21, 2025
@drin drin changed the title Fix: Do not normalize table names when deserializing from protobuf Fix: Do not normalize table names when deserializing from protobuf (backport to branch-48) Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate proto Related to proto crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant