Expand description
Unwrap casts in binary comparisons for physical expressions
This module provides optimization for physical expressions similar to the logical optimizer’s unwrap_cast module. It attempts to remove casts from comparisons to literals by applying the casts to the literals if possible.
The optimization improves performance by:
- Reducing runtime cast operations on column data
- Enabling better predicate pushdown opportunities
- Optimizing filter expressions in physical plans
§Example
Physical expression: cast(column as INT64) > INT64(10)
Optimized to: column > INT32(10) (assuming column is INT32)
Functions§
- extract_
cast_ 🔒info - Extract cast information from a physical expression
- try_
unwrap_ 🔒cast_ binary - Try to unwrap casts in binary expressions
- try_
unwrap_ 🔒cast_ comparison - Try to unwrap a cast in comparison by moving the cast to the literal
- unwrap_
cast_ 🔒in_ comparison - Attempts to unwrap casts in comparison expressions.