You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(physical-expr-common): add proto helpers for variant match and required scalar field
Expressions migrating to `try_to_proto` / `try_from_proto` (apache#22418)
keep hand-rolling two shapes that don't fit the existing
`encode_child` / `decode_required_expression` helpers from apache#22513:
- the outer `match &node.expr_type { ... }` that opens every
`try_from_proto`, and
- the `ok_or_else(|| internal_datafusion_err!("X is missing required
field 'Y'"))` for non-expression fields like `arrow_type` on
`CastExpr` / `TryCastExpr`.
This commit adds two thin helpers, both gated on `feature = "proto"`:
- `expect_expr_variant!` macro (re-exported at crate root) — matches
`Option<ExprType>` and returns the inner payload (auto-derefs
through `Box`), or returns an `internal_err!` naming the expected
variant.
- `proto_decode::require_proto_field<T>` — mirrors
`decode_required_expression` for non-`PhysicalExprNode` fields,
keeping the "missing required field" message format in one place.
No existing call sites are migrated in this commit; the follow-up
ports the already-migrated expressions onto these helpers.
0 commit comments