diff --git a/datafusion/core/src/datasource/file_format/json.rs b/datafusion/core/src/datasource/file_format/json.rs index 8948bf6345a9..950c86df71ba 100644 --- a/datafusion/core/src/datasource/file_format/json.rs +++ b/datafusion/core/src/datasource/file_format/json.rs @@ -33,7 +33,9 @@ use crate::datasource::data_source::FileSourceConfig; use crate::datasource::file_format::file_compression_type::FileCompressionType; use crate::datasource::file_format::write::demux::DemuxedStreamReceiver; use crate::datasource::file_format::write::BatchSerializer; -use crate::datasource::physical_plan::{FileGroupDisplay, FileSink, FileSinkConfig, JsonConfig}; +use crate::datasource::physical_plan::{ + FileGroupDisplay, FileSink, FileSinkConfig, JsonConfig, +}; use crate::error::Result; use crate::execution::context::SessionState; use crate::physical_plan::insert::{DataSink, DataSinkExec}; diff --git a/datafusion/core/src/datasource/file_format/parquet.rs b/datafusion/core/src/datasource/file_format/parquet.rs index 775b9c440ae3..917418d02aba 100644 --- a/datafusion/core/src/datasource/file_format/parquet.rs +++ b/datafusion/core/src/datasource/file_format/parquet.rs @@ -32,12 +32,13 @@ use super::{ }; use crate::arrow::array::RecordBatch; use crate::arrow::datatypes::{Fields, Schema, SchemaRef}; +use crate::datasource::data_source::FileSourceConfig; use crate::datasource::file_format::file_compression_type::FileCompressionType; use crate::datasource::file_format::write::get_writer_schema; -use crate::datasource::physical_plan::parquet::{ - can_expr_be_pushed_down_with_schemas, +use crate::datasource::physical_plan::parquet::can_expr_be_pushed_down_with_schemas; +use crate::datasource::physical_plan::{ + FileGroupDisplay, FileSink, FileSinkConfig, ParquetConfig, }; -use crate::datasource::physical_plan::{FileGroupDisplay, FileSink, FileSinkConfig}; use crate::datasource::statistics::{create_max_min_accs, get_col_stats}; use crate::error::Result; use crate::execution::context::SessionState; @@ -46,7 +47,6 @@ use crate::physical_plan::{ Accumulator, DisplayAs, DisplayFormatType, ExecutionPlan, SendableRecordBatchStream, Statistics, }; -use crate::datasource::data_source::FileSourceConfig; use arrow::compute::sum; use datafusion_common::config::{ConfigField, ConfigFileType, TableParquetOptions}; diff --git a/datafusion/core/src/physical_planner.rs b/datafusion/core/src/physical_planner.rs index 7664d1287090..c89b4b2aa5da 100644 --- a/datafusion/core/src/physical_planner.rs +++ b/datafusion/core/src/physical_planner.rs @@ -466,9 +466,8 @@ impl DefaultPhysicalPlanner { .collect::>>>() }) .collect::>>()?; - let value_exec = - MemoryExec::try_new_as_values(SchemaRef::new(exec_schema), exprs)?; - Arc::new(value_exec) + MemorySourceConfig::try_new_as_values(SchemaRef::new(exec_schema), exprs)? + as _ } LogicalPlan::EmptyRelation(EmptyRelation { produce_one_row: false, diff --git a/datafusion/physical-plan/src/memory.rs b/datafusion/physical-plan/src/memory.rs index dd5db6278a7f..58800ecf72b6 100644 --- a/datafusion/physical-plan/src/memory.rs +++ b/datafusion/physical-plan/src/memory.rs @@ -816,7 +816,8 @@ mod tests { Field::new("col0", DataType::UInt32, false), Field::new("col1", DataType::Utf8, false), ])); - let _ = MemorySourceConfig::try_new_from_batches(invalid_schema, batches).unwrap_err(); + let _ = MemorySourceConfig::try_new_from_batches(invalid_schema, batches) + .unwrap_err(); } // Test issue: https://github.com/apache/datafusion/issues/8763 @@ -827,8 +828,11 @@ mod tests { DataType::UInt32, false, )])); - let _ = MemorySourceConfig::try_new_as_values(Arc::clone(&schema), vec![vec![lit(1u32)]]) - .unwrap(); + let _ = MemorySourceConfig::try_new_as_values( + Arc::clone(&schema), + vec![vec![lit(1u32)]], + ) + .unwrap(); // Test that a null value is rejected let _ = MemorySourceConfig::try_new_as_values( schema,