Skip to content

Commit 0259de9

Browse files
committed
Fix compilation errors in vortex-datafusion for DF52
- Add missing imports: VortexResult, case_when, case_when_no_else, vortex_bail - Fix can_be_pushed_down -> can_be_pushed_down_impl in non-trait contexts - Remove duplicate can_case_be_pushed_down function (keep searched CASE version) - Remove duplicate projection/try_pushdown_projection methods (keep non-Option version) - Re-add FileScanConfigBuilder import removed in previous commit
1 parent bbc10de commit 0259de9

4 files changed

Lines changed: 9 additions & 35 deletions

File tree

vortex-array/src/scalar_fn/fns/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
pub mod between;
55
pub mod binary;
6+
pub mod case_when;
67
pub mod cast;
78
pub mod dynamic;
89
pub mod fill_null;

vortex-datafusion/src/convert/exprs.rs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ use vortex::scalar_fn::ScalarFnVTableExt;
3737
use vortex::scalar_fn::fns::binary::Binary;
3838
use vortex::scalar_fn::fns::like::Like;
3939
use vortex::scalar_fn::fns::like::LikeOptions;
40+
use vortex::scalar_fn::fns::case_when::case_when;
41+
use vortex::scalar_fn::fns::case_when::case_when_no_else;
4042
use vortex::scalar_fn::fns::operators::Operator;
43+
use vortex::error::VortexResult;
44+
use vortex::error::vortex_bail;
4145

4246
use crate::convert::FromDataFusion;
4347

@@ -511,22 +515,6 @@ fn can_binary_be_pushed_down(binary: &df_expr::BinaryExpr, schema: &Schema) -> b
511515
&& can_be_pushed_down_impl(binary.right(), schema)
512516
}
513517

514-
fn can_case_be_pushed_down(case_expr: &df_expr::CaseExpr, schema: &Schema) -> bool {
515-
case_expr
516-
.expr()
517-
.is_none_or(|base_expr| can_be_pushed_down_impl(base_expr, schema))
518-
&& case_expr
519-
.when_then_expr()
520-
.iter()
521-
.all(|(when_expr, then_expr)| {
522-
can_be_pushed_down_impl(when_expr, schema)
523-
&& can_be_pushed_down_impl(then_expr, schema)
524-
})
525-
&& case_expr
526-
.else_expr()
527-
.is_some_and(|else_expr| can_be_pushed_down_impl(else_expr, schema))
528-
}
529-
530518
fn can_case_be_pushed_down(case_expr: &df_expr::CaseExpr, schema: &Schema) -> bool {
531519
// We only support the "searched CASE" form (CASE WHEN cond THEN result ...)
532520
// not the "simple CASE" form (CASE expr WHEN value THEN result ...)
@@ -536,14 +524,14 @@ fn can_case_be_pushed_down(case_expr: &df_expr::CaseExpr, schema: &Schema) -> bo
536524

537525
// Check all when/then pairs
538526
for (when_expr, then_expr) in case_expr.when_then_expr() {
539-
if !can_be_pushed_down(when_expr, schema) || !can_be_pushed_down(then_expr, schema) {
527+
if !can_be_pushed_down_impl(when_expr, schema) || !can_be_pushed_down_impl(then_expr, schema) {
540528
return false;
541529
}
542530
}
543531

544532
// Check the optional else clause
545533
if let Some(else_expr) = case_expr.else_expr()
546-
&& !can_be_pushed_down(else_expr, schema)
534+
&& !can_be_pushed_down_impl(else_expr, schema)
547535
{
548536
return false;
549537
}
@@ -591,7 +579,7 @@ fn can_scalar_fn_be_pushed_down(scalar_fn: &ScalarFunctionExpr, schema: &Schema)
591579
&& scalar_fn
592580
.args()
593581
.iter()
594-
.all(|arg| can_be_pushed_down(arg, schema))
582+
.all(|arg| can_be_pushed_down_impl(arg, schema))
595583
}
596584

597585
// TODO(adam): Replace with `DataType::is_decimal` once its released.

vortex-datafusion/src/persistent/format.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use datafusion_datasource::file_compression_type::FileCompressionType;
2828
use datafusion_datasource::file_format::FileFormat;
2929
use datafusion_datasource::file_format::FileFormatFactory;
3030
use datafusion_datasource::file_scan_config::FileScanConfig;
31+
use datafusion_datasource::file_scan_config::FileScanConfigBuilder;
3132
use datafusion_datasource::file_sink_config::FileSinkConfig;
3233
use datafusion_datasource::sink::DataSinkExec;
3334
use datafusion_datasource::source::DataSourceExec;

vortex-datafusion/src/persistent/source.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -222,22 +222,6 @@ impl FileSource for VortexSource {
222222
VORTEX_FILE_EXTENSION
223223
}
224224

225-
fn projection(&self) -> Option<&ProjectionExprs> {
226-
self.projection.as_ref()
227-
}
228-
229-
fn try_pushdown_projection(
230-
&self,
231-
projection: &ProjectionExprs,
232-
) -> DFResult<Option<Arc<dyn FileSource>>> {
233-
let mut source = self.clone();
234-
source.projection = match &self.projection {
235-
Some(existing) => Some(existing.try_merge(projection)?),
236-
None => Some(projection.clone()),
237-
};
238-
Ok(Some(Arc::new(source)))
239-
}
240-
241225
fn fmt_extra(&self, t: DisplayFormatType, f: &mut Formatter) -> std::fmt::Result {
242226
match t {
243227
DisplayFormatType::Default | DisplayFormatType::Verbose => {

0 commit comments

Comments
 (0)