logan-keede commented on code in PR #14517: URL: https://github.com/apache/datafusion/pull/14517#discussion_r1943450081
########## datafusion/catalog-listing/src/file_scan_config.rs: ########## @@ -0,0 +1,1616 @@ +// 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. + +//! [`FileScanConfig`] to configure scanning of possibly partitioned +//! file sources. + +use std::{ + borrow::Cow, + collections::HashMap, + fmt::{Debug, Formatter, Result as FmtResult}, + marker::PhantomData, + mem::size_of, + sync::Arc, + vec, +}; + +use crate::minmax_statistics::MinMaxStatistics; +use crate::PartitionedFile; +use datafusion_common::error::Result; +use datafusion_common::scalar::ScalarValue; +use datafusion_execution::object_store::ObjectStoreUrl; + +use arrow::array::{ArrayData, BufferBuilder}; +use arrow::array::{ArrayRef, DictionaryArray, RecordBatch, RecordBatchOptions}; +use arrow::buffer::Buffer; +use arrow::datatypes::{ArrowNativeType, UInt16Type}; +use arrow_schema::{DataType, Field, Schema, SchemaRef}; +use datafusion_common::stats::Precision; +use datafusion_common::{ + exec_err, ColumnStatistics, Constraints, DataFusionError, Statistics, +}; +use datafusion_physical_expr::expressions::Column; +use datafusion_physical_expr::{LexOrdering, PhysicalSortExpr}; + +use datafusion_physical_plan::display::display_orderings; +use datafusion_physical_plan::display::ProjectSchemaDisplay; +use datafusion_physical_plan::DisplayAs; +use datafusion_physical_plan::DisplayFormatType; +use log::{debug, warn}; + +/// A wrapper to customize partitioned file display +/// +/// Prints in the format: +/// ```text +/// {NUM_GROUPS groups: [[file1, file2,...], [fileN, fileM, ...], ...]} +/// ``` +#[derive(Debug)] +struct FileGroupsDisplay<'a>(&'a [Vec<PartitionedFile>]); + +impl DisplayAs for FileGroupsDisplay<'_> { Review Comment: maybe, keeping a separate file for addition on old `file_scan_config` would be better? -- 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