Skip to content

Commit 1db2215

Browse files
committed
DataFusion 52 migration
1 parent 3a695ed commit 1db2215

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

native/core/src/execution/planner.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3388,13 +3388,16 @@ mod tests {
33883388
use datafusion::logical_expr::ScalarUDF;
33893389
use datafusion::physical_plan::ExecutionPlan;
33903390
use datafusion::{assert_batches_eq, physical_plan::common::collect, prelude::SessionContext};
3391+
use datafusion_physical_expr_adapter::PhysicalExprAdapterFactory;
33913392
use tempfile::TempDir;
33923393
use tokio::sync::mpsc;
33933394

33943395
use crate::execution::{operators::InputBatch, planner::PhysicalPlanner};
33953396

33963397
use crate::execution::operators::ExecutionError;
33973398
use crate::execution::planner::literal_to_array_ref;
3399+
use crate::parquet::parquet_support::SparkParquetOptions;
3400+
use crate::parquet::schema_adapter::SparkPhysicalExprAdapterFactory;
33983401
use datafusion_comet_proto::spark_expression::expr::ExprStruct;
33993402
use datafusion_comet_proto::spark_expression::ListLiteral;
34003403
use datafusion_comet_proto::{
@@ -3404,6 +3407,7 @@ mod tests {
34043407
spark_operator,
34053408
spark_operator::{operator::OpStruct, Operator},
34063409
};
3410+
use datafusion_comet_spark_expr::EvalMode;
34073411

34083412
#[test]
34093413
fn test_unpack_dictionary_primitive() {
@@ -4000,8 +4004,15 @@ mod tests {
40004004
.with_table_parquet_options(TableParquetOptions::new()),
40014005
) as Arc<dyn FileSource>;
40024006

4007+
let spark_parquet_options = SparkParquetOptions::new(EvalMode::Legacy, "UTC", false);
4008+
4009+
let expr_adapter_factory: Arc<dyn PhysicalExprAdapterFactory> = Arc::new(
4010+
SparkPhysicalExprAdapterFactory::new(spark_parquet_options, None),
4011+
);
4012+
40034013
let object_store_url = ObjectStoreUrl::local_filesystem();
40044014
let file_scan_config = FileScanConfigBuilder::new(object_store_url, source)
4015+
.with_expr_adapter(Some(expr_adapter_factory))
40054016
.with_file_groups(file_groups)
40064017
.build();
40074018

native/core/src/parquet/schema_adapter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ impl SchemaMapper for SchemaMapping {
412412
/// columns, so if one needs a RecordBatch with a schema that references columns which are not
413413
/// in the projected, it would be better to use `map_partial_batch`
414414
fn map_batch(&self, batch: RecordBatch) -> datafusion::common::Result<RecordBatch> {
415+
dbg!("map_batch");
415416
let batch_rows = batch.num_rows();
416417
let batch_cols = batch.columns().to_vec();
417418

0 commit comments

Comments
 (0)