Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions vortex-datafusion/src/convert/exprs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,6 @@ impl ExpressionConvertor for DefaultExpressionConvertor {
return Ok(TreeNodeRecursion::Stop);
}

// If the projection contains a `CastColumnExpr` that casts to physical types that don't have a 1:1 mapping
// with Vortex's types system, we make sure to pull the input from the file and keep the projection
if let Some(cast_expr) = node.as_any().downcast_ref::<df_expr::CastColumnExpr>()
&& is_dtype_incompatible(cast_expr.target_field().data_type())
{
scan_projection.push((
cast_expr.input_field().name().clone(),
self.convert(cast_expr.expr().as_ref())?,
));
leftover_projection.push(projection_expr.clone());
return Ok(TreeNodeRecursion::Stop);
}

// DataFusion assumes different decimal types can be coerced.
// Vortex expects a perfect match so we don't push it down.
if let Some(binary_expr) = node.as_any().downcast_ref::<df_expr::BinaryExpr>()
Expand Down Expand Up @@ -430,25 +417,6 @@ fn can_scalar_fn_be_pushed_down(scalar_fn: &ScalarFunctionExpr) -> bool {
ScalarFunctionExpr::try_downcast_func::<GetFieldFunc>(scalar_fn).is_some()
}

fn is_dtype_incompatible(dt: &DataType) -> bool {
use DataType::*;

dt.is_run_ends_type()
|| is_decimal(dt)
|| matches!(
dt,
Dictionary(..)
| Utf8
| LargeUtf8
| Binary
| LargeBinary
| FixedSizeBinary(_)
| FixedSizeList(..)
| ListView(..)
| LargeListView(..)
)
}

// TODO(adam): Replace with `DataType::is_decimal` once its released.
fn is_decimal(dt: &DataType) -> bool {
matches!(
Expand Down
1 change: 1 addition & 0 deletions vortex-datafusion/src/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use vortex::error::VortexResult;

pub(crate) mod exprs;
mod scalars;
pub(crate) mod schema;

/// First-party trait for implementing conversion from DataFusion types to Vortex types.
pub(crate) trait FromDataFusion<D: ?Sized>: Sized {
Expand Down
Loading
Loading