Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove many crate:: imports in listing table provider module #11887

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions datafusion/core/src/datasource/listing/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ use std::collections::HashMap;
use std::mem;
use std::sync::Arc;

use super::ListingTableUrl;
use super::PartitionedFile;
use crate::datasource::listing::ListingTableUrl;
use crate::execution::context::SessionState;
use crate::logical_expr::{BinaryExpr, Operator};
use crate::{error::Result, scalar::ScalarValue};
use datafusion_common::{Result, ScalarValue};
use datafusion_expr::{BinaryExpr, Operator};

use arrow::{
array::{Array, ArrayRef, AsArray, StringBuilder},
Expand Down Expand Up @@ -518,8 +518,8 @@ mod tests {

use futures::StreamExt;

use crate::logical_expr::{case, col, lit, Expr};
use crate::test::object_store::make_test_store_and_state;
use datafusion_expr::{case, col, lit, Expr};

use super::*;

Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/src/datasource/listing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ mod helpers;
mod table;
mod url;

use crate::error::Result;
use chrono::TimeZone;
use datafusion_common::Result;
use datafusion_common::{ScalarValue, Statistics};
use futures::Stream;
use object_store::{path::Path, ObjectMeta};
Expand Down Expand Up @@ -162,7 +162,7 @@ impl From<ObjectMeta> for PartitionedFile {

#[cfg(test)]
mod tests {
use crate::datasource::listing::ListingTableUrl;
use super::ListingTableUrl;
use datafusion_execution::object_store::{
DefaultObjectStoreRegistry, ObjectStoreRegistry,
};
Expand Down
25 changes: 11 additions & 14 deletions datafusion/core/src/datasource/listing/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@ use std::{any::Any, sync::Arc};
use super::helpers::{expr_applicable_for_cols, pruned_partition_list, split_files};
use super::PartitionedFile;

use crate::catalog::TableProvider;
use crate::datasource::{create_ordering, get_statistics_with_limit, TableType};
use super::ListingTableUrl;
use crate::datasource::{create_ordering, get_statistics_with_limit};
use crate::datasource::{
file_format::{file_compression_type::FileCompressionType, FileFormat},
listing::ListingTableUrl,
physical_plan::{FileScanConfig, FileSinkConfig},
};
use crate::{
error::{DataFusionError, Result},
execution::context::SessionState,
logical_expr::{utils::conjunction, Expr, TableProviderFilterPushDown},
physical_plan::{empty::EmptyExec, ExecutionPlan, Statistics},
};
use crate::execution::context::SessionState;
use datafusion_catalog::TableProvider;
use datafusion_common::{DataFusionError, Result};
use datafusion_expr::TableType;
use datafusion_expr::{utils::conjunction, Expr, TableProviderFilterPushDown};
use datafusion_physical_plan::{empty::EmptyExec, ExecutionPlan, Statistics};

use arrow::datatypes::{DataType, Field, SchemaBuilder, SchemaRef};
use arrow_schema::Schema;
Expand Down Expand Up @@ -1051,12 +1050,12 @@ mod tests {
use crate::datasource::file_format::parquet::ParquetFormat;
use crate::datasource::{provider_as_source, MemTable};
use crate::execution::options::ArrowReadOptions;
use crate::physical_plan::collect;
use crate::prelude::*;
use crate::{
assert_batches_eq,
test::{columns, object_store::register_test_store},
};
use datafusion_physical_plan::collect;

use arrow::record_batch::RecordBatch;
use arrow_schema::SortOptions;
Expand Down Expand Up @@ -1154,10 +1153,8 @@ mod tests {
let options = ListingOptions::new(Arc::new(ParquetFormat::default()));
let schema = options.infer_schema(&state, &table_path).await.unwrap();

use crate::{
datasource::file_format::parquet::ParquetFormat,
physical_plan::expressions::col as physical_col,
};
use crate::datasource::file_format::parquet::ParquetFormat;
use datafusion_physical_plan::expressions::col as physical_col;
use std::ops::Add;

// (file_sort_order, expected_result)
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/datasource/listing/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.

use crate::datasource::object_store::ObjectStoreUrl;
use crate::execution::context::SessionState;
use datafusion_common::{DataFusionError, Result};
use datafusion_execution::object_store::ObjectStoreUrl;
use datafusion_optimizer::OptimizerConfig;
use futures::stream::BoxStream;
use futures::{StreamExt, TryStreamExt};
Expand Down