-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Integrate cast_column into PhysicalExprAdapter
source: #17281 (comment)
Implementation Plan: CastColumnExpr
-
Introduce
CastColumnExpritself. 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. -
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. -
Add serialization / deserialization support. Wire
CastColumnExprthrough the protobuf schema, the to/from proto converters, and the round-trip tests so distributed execution can safely move plans containing it. -
Update pruning to handle
CastColumnExpr. Once the new node is available everywhere, extendrewrite_expr_to_prunableand its regression tests so statistics-based pruning continues to work with casted columns. -
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.
-
Finally, switch the adapter to
CastColumnExprand add behavior tests. Make the actual rewrite produceCastColumnExpr, 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.