Module unwrap_cast

Module unwrap_cast 

Source
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:

  1. Reducing runtime cast operations on column data
  2. Enabling better predicate pushdown opportunities
  3. 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.