Skip to content

Integrate cast_column into PhysicalExprAdapter #17330

@kosiew

Description

@kosiew

Integrate cast_column into PhysicalExprAdapter

source: #17281 (comment)

Implementation Plan: CastColumnExpr

  1. Introduce CastColumnExpr itself. Add the new expression type, its evaluation semantics for arrays and scalars, nullable/return-field fixes, and dedicated unit tests in the physical expression crate, together with the public re-export.

  2. Teach the physical-expression utilities about CastColumnExpr. Extend equivalence tracking, interval reasoning, and cast-unwrapping simplifications (plus their tests) so the optimizer understands the new node before any other subsystem depends on it.

  3. Add serialization / deserialization support. Wire CastColumnExpr through the protobuf schema, the to/from proto converters, and the round-trip tests so distributed execution can safely move plans containing it.

  4. Update pruning to handle CastColumnExpr. Once the new node is available everywhere, extend rewrite_expr_to_prunable and its regression tests so statistics-based pruning continues to work with casted columns.

  5. Refactor the schema rewriter in preparation. Land the structural cleanup and new helper routines (like the quick struct compatibility check) independently so reviewers can verify the reshaping without functional changes mixed in.

  6. Finally, switch the adapter to CastColumnExpr and add behavior tests. Make the actual rewrite produce CastColumnExpr, rely on the struct-aware casting path, and add the new error / round-trip tests that prove the behavior with missing fields and nullable handling.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions