mbutrovich commented on code in PR #1443: URL: https://github.com/apache/datafusion-comet/pull/1443#discussion_r1999472634
########## native/core/src/parquet/mod.rs: ########## @@ -46,23 +47,22 @@ use self::util::jni::TypePromotionInfo; use crate::execution::operators::ExecutionError; use crate::execution::utils::SparkArrowConvert; use crate::parquet::data_type::AsBytes; -use crate::parquet::parquet_support::{prepare_object_store, SparkParquetOptions}; -use crate::parquet::schema_adapter::SparkSchemaAdapterFactory; +use crate::parquet::parquet_exec::init_parquet_exec; +use crate::parquet::parquet_support::prepare_object_store; use arrow::array::{Array, RecordBatch}; use arrow::buffer::{Buffer, MutableBuffer}; -use datafusion::common::config::TableParquetOptions; use datafusion::datasource::listing::PartitionedFile; -use datafusion::datasource::physical_plan::{FileScanConfig, ParquetSource}; -use datafusion::datasource::source::DataSourceExec; use datafusion::execution::{SendableRecordBatchStream, TaskContext}; use datafusion::physical_plan::ExecutionPlan; use datafusion::prelude::SessionContext; -use datafusion_comet_spark_expr::EvalMode; +// use datafusion_execution::{SendableRecordBatchStream, TaskContext}; Review Comment: Commented out include. ########## native/core/src/parquet/parquet_exec.rs: ########## @@ -0,0 +1,139 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use crate::execution::operators::ExecutionError; +use crate::parquet::parquet_support::SparkParquetOptions; +use crate::parquet::schema_adapter::SparkSchemaAdapterFactory; +use arrow::datatypes::{Field, SchemaRef}; +use datafusion::config::TableParquetOptions; +use datafusion::datasource::listing::PartitionedFile; +use datafusion::datasource::physical_plan::{FileScanConfig, FileSource, ParquetSource}; +use datafusion::datasource::source::DataSourceExec; +use datafusion::execution::object_store::ObjectStoreUrl; +use datafusion::physical_expr::expressions::BinaryExpr; +use datafusion::physical_expr::PhysicalExpr; +use datafusion_comet_spark_expr::EvalMode; +use itertools::Itertools; +use std::sync::Arc; + +/// Initializes a DataSourceExec plan with a ParquetSource. This may be used by either the +/// `native_datafusion` scan or the `native_iceberg_compat` scan. +/// +/// `required_schema`: Schema to be projected by the scan. +/// +/// `data_schema`: Schema of the underlying data. It is optional and, if provided, is used +/// instead of `required_schema` to initialize the file scan +/// +/// `partition_schema` and `partition_fields` are optional. If `partition_schema` is specified, +/// then `partition_fields` must also be specified +/// +/// `object_store_url`: Url to read data from +/// +/// `file_groups`: A collection of groups of `PartitionedFiles` that are to be read by the scan +/// +/// `projection_vector`: A vector of the indexes in the schema of the fields to be projected +/// +/// `data_filters`: Any predicate that must be applied to the data returned by the scan. If +/// specified, then `data_schema` must also be specified. +#[allow(clippy::too_many_arguments)] +pub(crate) fn init_parquet_exec( Review Comment: DF recently renamed to `DataSourceExec`, so let's follow that. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org