Skip to content

Commit

Permalink
complete update usages
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Nov 7, 2023
1 parent f84940c commit 87aeef5
Show file tree
Hide file tree
Showing 34 changed files with 69 additions and 34 deletions.
2 changes: 1 addition & 1 deletion datafusion-examples/examples/json_opener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use datafusion::{
error::Result,
physical_plan::metrics::ExecutionPlanMetricsSet,
};
use datafusion_common::Statistics;
use datafusion_statistics::Statistics

use futures::StreamExt;
use object_store::ObjectStore;
Expand Down
3 changes: 2 additions & 1 deletion datafusion/core/src/datasource/file_format/arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ use arrow::ipc::root_as_message;
use arrow_schema::{ArrowError, Schema, SchemaRef};

use bytes::Bytes;
use datafusion_common::{FileType, Statistics};
use datafusion_common::FileType;
use datafusion_physical_expr::PhysicalExpr;
use datafusion_statistics::Statistics;

use async_trait::async_trait;
use futures::stream::BoxStream;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/datasource/file_format/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,10 @@ mod tests {
use chrono::DateTime;
use datafusion_common::cast::as_string_array;
use datafusion_common::internal_err;
use datafusion_common::stats::Precision;
use datafusion_common::FileType;
use datafusion_common::GetExt;
use datafusion_expr::{col, lit};
use datafusion_statistics::Precision;
use futures::StreamExt;
use object_store::local::LocalFileSystem;
use object_store::path::Path;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/datasource/file_format/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ impl DataSink for JsonSink {
mod tests {
use super::super::test_util::scan_format;
use datafusion_common::cast::as_int64_array;
use datafusion_common::stats::Precision;
use datafusion_statistics::Precision;
use futures::StreamExt;
use object_store::local::LocalFileSystem;

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 @@ -19,8 +19,8 @@

use arrow_array::RecordBatch;
use async_trait::async_trait;
use datafusion_common::stats::Precision;
use datafusion_physical_plan::metrics::MetricsSet;
use datafusion_statistics::Precision;
use parquet::arrow::arrow_writer::{
compute_leaves, get_column_writers, ArrowColumnChunk, ArrowColumnWriter,
ArrowLeafColumn,
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/datasource/listing/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,9 +1040,9 @@ mod tests {

use arrow::datatypes::{DataType, Schema};
use arrow::record_batch::RecordBatch;
use datafusion_common::stats::Precision;
use datafusion_common::{assert_contains, GetExt, ScalarValue};
use datafusion_expr::{BinaryExpr, LogicalPlanBuilder, Operator};
use datafusion_statistics::Precision;
use rstest::*;
use tempfile::TempDir;

Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/datasource/physical_plan/arrow_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ use crate::physical_plan::{
};

use arrow_schema::SchemaRef;
use datafusion_common::Statistics;
use datafusion_execution::TaskContext;
use datafusion_physical_expr::{EquivalenceProperties, LexOrdering, PhysicalSortExpr};
use datafusion_statistics::Statistics;

use futures::StreamExt;
use object_store::{GetResultPayload, ObjectStore};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ use arrow::buffer::Buffer;
use arrow::datatypes::{ArrowNativeType, UInt16Type};
use arrow_array::{ArrayRef, DictionaryArray, RecordBatch, RecordBatchOptions};
use arrow_schema::{DataType, Field, Schema, SchemaRef};
use datafusion_common::stats::Precision;
use datafusion_common::{exec_err, ColumnStatistics, Statistics};
use datafusion_common::exec_err;
use datafusion_physical_expr::LexOrdering;
use datafusion_statistics::Precision;
use datafusion_statistics::{ColumnStatistics, Statistics};

use itertools::Itertools;
use log::warn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ mod tests {
use arrow_schema::Schema;
use datafusion_common::internal_err;
use datafusion_common::DataFusionError;
use datafusion_common::Statistics;
use datafusion_statistics::Statistics;

use super::*;
use crate::datasource::file_format::write::BatchSerializer;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/datasource/physical_plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ mod tests {
/// Unit tests for `repartition_file_groups()`
#[cfg(feature = "parquet")]
mod repartition_file_groups_test {
use datafusion_common::Statistics;
use datafusion_statistics::Statistics;
use itertools::Itertools;

use super::*;
Expand Down
3 changes: 2 additions & 1 deletion datafusion/core/src/datasource/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ use std::any::Any;
use std::sync::Arc;

use async_trait::async_trait;
use datafusion_common::{not_impl_err, Constraints, DataFusionError, Statistics};
use datafusion_common::{not_impl_err, Constraints, DataFusionError};
use datafusion_expr::{CreateExternalTable, LogicalPlan};
pub use datafusion_expr::{TableProviderFilterPushDown, TableType};
use datafusion_statistics::Statistics;

use crate::arrow::datatypes::SchemaRef;
use crate::error::Result;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/datasource/statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use crate::error::Result;
use crate::physical_plan::expressions::{MaxAccumulator, MinAccumulator};
use crate::physical_plan::{Accumulator, ColumnStatistics, Statistics};

use datafusion_common::stats::Precision;
use datafusion_common::ScalarValue;
use datafusion_statistics::Precision;

use futures::{Stream, StreamExt};
use itertools::izip;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ use crate::physical_plan::projection::ProjectionExec;
use crate::physical_plan::{expressions, AggregateExpr, ExecutionPlan, Statistics};
use crate::scalar::ScalarValue;

use datafusion_common::stats::Precision;
use datafusion_common::tree_node::TreeNode;
use datafusion_expr::utils::COUNT_STAR_EXPANSION;
use datafusion_statistics::Precision;

/// Optimizer that uses available statistics for aggregate functions
#[derive(Default)]
Expand Down
3 changes: 2 additions & 1 deletion datafusion/core/src/physical_optimizer/join_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,10 @@ mod tests_statistical {
};

use arrow::datatypes::{DataType, Field, Schema};
use datafusion_common::{stats::Precision, JoinType, ScalarValue};
use datafusion_common::{JoinType, ScalarValue};
use datafusion_physical_expr::expressions::Column;
use datafusion_physical_expr::PhysicalExpr;
use datafusion_statistics::Precision;

fn create_big_and_small() -> (Arc<dyn ExecutionPlan>, Arc<dyn ExecutionPlan>) {
let big = Arc::new(StatisticsExec::new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ use crate::physical_plan::{DisplayAs, DisplayFormatType, ExecutionPlan};
use arrow_schema::SchemaRef;
use datafusion_common::config::ConfigOptions;
use datafusion_common::tree_node::{Transformed, TreeNode};
use datafusion_common::{Result, Statistics};
use datafusion_common::Result;
use datafusion_physical_expr::{
Distribution, LexRequirement, PhysicalSortExpr, PhysicalSortRequirement,
};
use datafusion_physical_plan::sorts::sort_preserving_merge::SortPreservingMergeExec;
use datafusion_statistics::Statistics;

/// This rule either adds or removes [`OutputRequirements`]s to/from the physical
/// plan according to its `mode` attribute, which is set by the constructors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,12 @@ mod tests {
use arrow::compute::SortOptions;
use arrow::datatypes::{DataType, Field, Schema, SchemaRef};
use datafusion_common::tree_node::TreeNode;
use datafusion_common::{Result, Statistics};
use datafusion_common::Result;
use datafusion_execution::object_store::ObjectStoreUrl;
use datafusion_expr::{JoinType, Operator};
use datafusion_physical_expr::expressions::{self, col, Column};
use datafusion_physical_expr::PhysicalSortExpr;
use datafusion_statistics::Statistics;

/// Runs the `replace_with_order_preserving_variants` sub-rule and asserts the plan
/// against the original and expected plans.
Expand Down
3 changes: 2 additions & 1 deletion datafusion/core/src/physical_optimizer/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ use crate::physical_plan::{ExecutionPlan, Partitioning};
use crate::prelude::{CsvReadOptions, SessionContext};

use arrow_schema::{Schema, SchemaRef, SortOptions};
use datafusion_common::{JoinType, Statistics};
use datafusion_common::JoinType;
use datafusion_execution::object_store::ObjectStoreUrl;
use datafusion_expr::{AggregateFunction, WindowFrame, WindowFunction};
use datafusion_physical_expr::expressions::col;
use datafusion_physical_expr::{PhysicalExpr, PhysicalSortExpr};
use datafusion_physical_plan::windows::PartitionSearchMode;
use datafusion_statistics::Statistics;

use async_trait::async_trait;

Expand Down
3 changes: 2 additions & 1 deletion datafusion/core/src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ use crate::test_util::{aggr_test_schema, arrow_test_data};
use arrow::array::{self, Array, ArrayRef, Decimal128Builder, Int32Array};
use arrow::datatypes::{DataType, Field, Schema, SchemaRef};
use arrow::record_batch::RecordBatch;
use datafusion_common::{DataFusionError, FileType, Statistics};
use datafusion_common::{DataFusionError, FileType};
use datafusion_execution::{SendableRecordBatchStream, TaskContext};
use datafusion_physical_expr::{Partitioning, PhysicalSortExpr};
use datafusion_physical_plan::{DisplayAs, DisplayFormatType};
use datafusion_statistics::Statistics;

#[cfg(feature = "compression")]
use bzip2::write::BzEncoder;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/test_util/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use crate::physical_plan::metrics::MetricsSet;
use crate::physical_plan::ExecutionPlan;
use crate::prelude::{Expr, SessionConfig};

use datafusion_common::Statistics;
use datafusion_statistics::Statistics;

use object_store::path::Path;
use object_store::ObjectMeta;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/tests/custom_sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use datafusion::physical_plan::{
use datafusion::scalar::ScalarValue;
use datafusion_common::cast::as_primitive_array;
use datafusion_common::project_schema;
use datafusion_common::stats::Precision;
use datafusion_statistics::Precision;

use async_trait::async_trait;
use futures::stream::Stream;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/tests/parquet/file_statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ use datafusion::datasource::physical_plan::ParquetExec;
use datafusion::datasource::TableProvider;
use datafusion::execution::context::SessionState;
use datafusion::prelude::SessionContext;
use datafusion_common::stats::Precision;
use datafusion_execution::cache::cache_manager::CacheManagerConfig;
use datafusion_execution::cache::cache_unit;
use datafusion_execution::cache::cache_unit::{
DefaultFileStatisticsCache, DefaultListFilesCache,
};
use datafusion_execution::config::SessionConfig;
use datafusion_execution::runtime_env::{RuntimeConfig, RuntimeEnv};
use datafusion_statistics::Precision;

use tempfile::tempdir;

Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/tests/path_partition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ use datafusion::{
prelude::SessionContext,
test_util::{self, arrow_test_data, parquet_test_data},
};
use datafusion_common::stats::Precision;
use datafusion_common::ScalarValue;
use datafusion_statistics::Precision;

use async_trait::async_trait;
use bytes::Bytes;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/execution/src/cache/cache_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ mod tests {
use crate::cache::CacheAccessor;
use arrow::datatypes::{DataType, Field, Schema, TimeUnit};
use chrono::DateTime;
use datafusion_common::Statistics;
use datafusion_statistics::Statistics;
use object_store::path::Path;
use object_store::ObjectMeta;

Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/joins/nested_loop_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use datafusion_execution::TaskContext;
use datafusion_expr::JoinType;
use datafusion_physical_expr::equivalence::join_equivalence_properties;
use datafusion_physical_expr::{EquivalenceProperties, PhysicalSortExpr};
use datafusion_statstics::Statistics;
use datafusion_statistics::Statistics;

use futures::{ready, Stream, StreamExt, TryStreamExt};

Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/joins/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use arrow::compute;
use arrow::datatypes::{Field, Schema, SchemaBuilder};
use arrow::record_batch::{RecordBatch, RecordBatchOptions};
use datafusion_common::cast::as_boolean_array;
use datafusion_common::stats::Precision;
use datafusion_common::{
plan_datafusion_err, plan_err, DataFusionError, JoinSide, JoinType, Result,
SharedResult,
Expand All @@ -47,6 +46,7 @@ use datafusion_physical_expr::utils::merge_vectors;
use datafusion_physical_expr::{
LexOrdering, LexOrderingRef, PhysicalExpr, PhysicalSortExpr,
};
use datafusion_statistics::Precision;

use futures::future::{BoxFuture, Shared};
use futures::{ready, FutureExt};
Expand Down
3 changes: 2 additions & 1 deletion datafusion/physical-plan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,14 @@ pub use crate::visitor::{accept, visit_execution_plan, ExecutionPlanVisitor};

use datafusion_common::config::ConfigOptions;
pub use datafusion_common::hash_utils;
pub use datafusion_common::internal_err;
pub use datafusion_common::utils::project_schema;
pub use datafusion_common::{internal_err, ColumnStatistics, Statistics};
pub use datafusion_expr::{Accumulator, ColumnarValue};
pub use datafusion_physical_expr::window::WindowExpr;
pub use datafusion_physical_expr::{
expressions, functions, udf, AggregateExpr, Distribution, Partitioning, PhysicalExpr,
};
pub use datafusion_statistics::{ColumnStatistics, Statistics};

// Backwards compatibility
pub use crate::stream::EmptyRecordBatchStream;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ use crate::{
use arrow::array::ArrayRef;
use arrow::datatypes::SchemaRef;
use arrow::record_batch::{RecordBatch, RecordBatchOptions};
use datafusion_common::stats::Precision;
use datafusion_common::{internal_err, DataFusionError, Result};
use datafusion_execution::TaskContext;
use datafusion_statistics::Precision;

use futures::stream::{Stream, StreamExt};
use log::trace;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/projection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ use crate::{

use arrow::datatypes::{Field, Schema, SchemaRef};
use arrow::record_batch::{RecordBatch, RecordBatchOptions};
use datafusion_common::stats::Precision;
use datafusion_common::Result;
use datafusion_execution::TaskContext;
use datafusion_physical_expr::expressions::{Literal, UnKnownColumn};
use datafusion_physical_expr::EquivalenceProperties;
use datafusion_statistics::Precision;

use datafusion_physical_expr::equivalence::ProjectionMapping;
use futures::stream::{Stream, StreamExt};
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/union.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ use crate::stream::ObservedStream;

use arrow::datatypes::{Field, Schema, SchemaRef};
use arrow::record_batch::RecordBatch;
use datafusion_common::stats::Precision;
use datafusion_common::{exec_err, internal_err, DFSchemaRef, DataFusionError, Result};
use datafusion_execution::TaskContext;
use datafusion_physical_expr::EquivalenceProperties;
use datafusion_statistics::Precision;

use futures::Stream;
use itertools::Itertools;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ use arrow::{
record_batch::RecordBatch,
};
use datafusion_common::hash_utils::create_hashes;
use datafusion_common::stats::Precision;
use datafusion_common::utils::{
evaluate_partition_ranges, get_arrayref_at_indices, get_at_indices,
get_record_batch_at_indices, get_row_at_idx,
Expand All @@ -60,6 +59,7 @@ use datafusion_physical_expr::window::{
use datafusion_physical_expr::{
EquivalenceProperties, PhysicalExpr, PhysicalSortRequirement,
};
use datafusion_statistics::Precision;

use ahash::RandomState;
use futures::stream::Stream;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/windows/window_agg_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ use arrow::{
datatypes::{Schema, SchemaRef},
record_batch::RecordBatch,
};
use datafusion_common::stats::Precision;
use datafusion_common::utils::evaluate_partition_ranges;
use datafusion_common::{internal_err, plan_err, DataFusionError, Result};
use datafusion_execution::TaskContext;
use datafusion_physical_expr::{EquivalenceProperties, PhysicalSortRequirement};
use datafusion_statistics::Precision;

use futures::stream::Stream;
use futures::{ready, StreamExt};
Expand Down
2 changes: 1 addition & 1 deletion datafusion/proto/src/physical_plan/from_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ use datafusion::physical_plan::windows::create_window_expr;
use datafusion::physical_plan::{
functions, ColumnStatistics, Partitioning, PhysicalExpr, Statistics, WindowExpr,
};
use datafusion_common::stats::Precision;
use datafusion_common::{not_impl_err, DataFusionError, JoinSide, Result, ScalarValue};
use datafusion_statistics::Precision;

use crate::common::proto_error;
use crate::convert_required;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/proto/tests/cases/roundtrip_physical_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ use datafusion::physical_plan::{
};
use datafusion::prelude::SessionContext;
use datafusion::scalar::ScalarValue;
use datafusion_common::stats::Precision;
use datafusion_common::Result;
use datafusion_expr::{
Accumulator, AccumulatorFactoryFunction, AggregateUDF, ReturnTypeFunction, Signature,
StateTypeFunction, WindowFrame, WindowFrameBound,
};
use datafusion_proto::physical_plan::{AsExecutionPlan, DefaultPhysicalExtensionCodec};
use datafusion_proto::protobuf;
use datafusion_statistics::Precision;

fn roundtrip_test(exec_plan: Arc<dyn ExecutionPlan>) -> Result<()> {
let ctx = SessionContext::new();
Expand Down
Loading

0 comments on commit 87aeef5

Please sign in to comment.