Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuqi-lucas committed Dec 31, 2024
1 parent b1a231b commit 30796bc
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 18 deletions.
4 changes: 2 additions & 2 deletions datafusion-examples/examples/custom_file_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ impl FileFormat for TSVFileFormat {

async fn infer_file_ordering(
&self,
store: &Arc<dyn ObjectStore>,
object: &ObjectMeta,
_store: &Arc<dyn ObjectStore>,
_object: &ObjectMeta,
) -> Option<&String> {
None
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/dataframe/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use std::sync::Arc;

use crate::datasource::file_format::{
format_as_file_type, parquet::ParquetFormatFactory, DefaultFileType,
format_as_file_type, parquet::ParquetFormatFactory,
};

use super::{
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/src/datasource/file_format/arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ impl FileFormat for ArrowFormat {

async fn infer_file_ordering(
&self,
store: &Arc<dyn ObjectStore>,
object: &ObjectMeta,
_store: &Arc<dyn ObjectStore>,
_object: &ObjectMeta,
) -> Option<String> {
// todo for now we don't support infer ordering for Arrow files
None
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/src/datasource/file_format/avro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ impl FileFormat for AvroFormat {

async fn infer_file_ordering(
&self,
store: &Arc<dyn ObjectStore>,
object: &ObjectMeta,
_store: &Arc<dyn ObjectStore>,
_object: &ObjectMeta,
) -> Option<String> {
// todo Avro files sort order are not sorted
None
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/src/datasource/file_format/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ impl FileFormat for CsvFormat {

async fn infer_file_ordering(
&self,
store: &Arc<dyn ObjectStore>,
object: &ObjectMeta,
_store: &Arc<dyn ObjectStore>,
_object: &ObjectMeta,
) -> Option<String> {
// CSV infer files order info is not supported
None
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/src/datasource/file_format/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ impl FileFormat for JsonFormat {

async fn infer_file_ordering(
&self,
store: &Arc<dyn ObjectStore>,
object: &ObjectMeta,
_store: &Arc<dyn ObjectStore>,
_object: &ObjectMeta,
) -> Option<String> {
// Json infer files order are not supported
None
Expand Down
12 changes: 10 additions & 2 deletions datafusion/core/src/datasource/file_format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ use crate::datasource::physical_plan::{FileScanConfig, FileSinkConfig};
use crate::error::Result;
use crate::execution::context::SessionState;
use crate::physical_plan::{ExecutionPlan, Statistics};
use ::parquet::arrow::parquet_to_arrow_schema;
use std::any::Any;
use std::collections::{HashMap, VecDeque};
use std::fmt::{self, Debug, Display};
Expand All @@ -50,7 +49,6 @@ use datafusion_common::{internal_err, not_impl_err, GetExt};
use datafusion_expr::Expr;
use datafusion_physical_expr::PhysicalExpr;

use crate::datasource::file_format::parquet::fetch_parquet_metadata;
use async_trait::async_trait;
use bytes::{Buf, Bytes};
use datafusion_physical_expr_common::sort_expr::LexRequirement;
Expand Down Expand Up @@ -124,6 +122,16 @@ pub trait FileFormat: Send + Sync + Debug {
object: &ObjectMeta,
) -> Result<Statistics>;

/// Infers the file ordering for a given object store and object meta.
///
/// # Arguments
///
/// * `store` - A reference to the object store.
/// * `object` - A reference to the object meta.
///
/// # Returns
///
/// An optional string representing the file ordering.
async fn infer_file_ordering(
&self,
store: &Arc<dyn ObjectStore>,
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/datasource/file_format/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ use parquet::arrow::{
arrow_to_parquet_schema, parquet_to_arrow_schema, AsyncArrowWriter,
};
use parquet::file::metadata::{
KeyValue, ParquetMetaData, ParquetMetaDataReader, RowGroupMetaData,
ParquetMetaData, ParquetMetaDataReader, RowGroupMetaData,
};
use parquet::file::properties::WriterProperties;
use parquet::file::writer::SerializedFileWriter;
Expand Down
4 changes: 0 additions & 4 deletions datafusion/core/src/datasource/listing/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use super::helpers::{expr_applicable_for_cols, pruned_partition_list, split_files};
use super::{ListingTableUrl, PartitionedFile};
use std::collections::HashMap;
use std::ops::Deref;
use std::{any::Any, str::FromStr, sync::Arc};

use crate::datasource::{
Expand Down Expand Up @@ -52,11 +51,8 @@ use datafusion_physical_expr::{
create_physical_expr, LexOrdering, PhysicalSortRequirement,
};

use crate::datasource::file_format::csv::CsvFormat;
use crate::datasource::file_format::parquet::ParquetFormat;
use async_trait::async_trait;
use datafusion_catalog::Session;
use datafusion_common::cse::FoundCommonNodes::No;
use datafusion_expr::expr::Sort;
use datafusion_physical_expr_common::sort_expr::LexRequirement;
use futures::{future, stream, StreamExt, TryStreamExt};
Expand Down

0 comments on commit 30796bc

Please sign in to comment.