Skip to content

Table names are normalized when roundtripping through protobuf #18122

@colinmarc

Description

@colinmarc

Describe the bug

Using datafusion-proto to serialize a plan such as:

Filter: WOW_SUCH_TABLE.a > Int64(10) AND WOW_SUCH_TABLE.B < Int64(100)
  TableScan: WOW_SUCH_TABLE projection=[a, B], partial_filters=[WOW_SUCH_TABLE.a > Int64(10), WOW_SUCH_TABLE.B < Int64(100)]

And then deserializing it results in a different plan:

Filter: wow_such_table.a > Int64(10) AND wow_such_table.B < Int64(100)
  TableScan: WOW_SUCH_TABLE projection=[a, B], partial_filters=[wow_such_table.a > Int64(10), wow_such_table.B < Int64(100)]

Note that the TableReference in the TableScan is intact, but the expression's Column is now normalized (downcased). This has nothing to do with enable_ident_normalization, because we're well past the SQL parser at this point.

The issue seems to be here:

Self::new(relation.map(|r| r.relation), name)

Because that calls Column::new, which takes an Into<TableReference>; and impl From<String> for TableReference normalizes.

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions