Skip to content

Commit 1aadce0

Browse files
authored
Initial commit (#13611)
1 parent 11d49b4 commit 1aadce0

File tree

19 files changed

+22
-36
lines changed

19 files changed

+22
-36
lines changed

datafusion-cli/Cargo.lock

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/common/src/cse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use crate::tree_node::{
2424
Transformed, TransformedResult, TreeNode, TreeNodeRecursion, TreeNodeRewriter,
2525
TreeNodeVisitor,
2626
};
27+
use crate::IndexMap;
2728
use crate::Result;
28-
use indexmap::IndexMap;
2929
use std::collections::HashMap;
3030
use std::hash::{BuildHasher, Hash, Hasher, RandomState};
3131
use std::marker::PhantomData;

datafusion/common/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ pub use param_value::ParamValues;
7373
pub use scalar::{ScalarType, ScalarValue};
7474
pub use schema_reference::SchemaReference;
7575
pub use stats::{ColumnStatistics, Statistics};
76+
use std::hash::RandomState;
7677
pub use table_reference::{ResolvedTableReference, TableReference};
7778
pub use unnest::{RecursionUnnestOption, UnnestOptions};
7879
pub use utils::project_schema;
@@ -93,6 +94,9 @@ pub use error::{
9394
pub type HashMap<K, V, S = DefaultHashBuilder> = hashbrown::HashMap<K, V, S>;
9495
pub type HashSet<T, S = DefaultHashBuilder> = hashbrown::HashSet<T, S>;
9596

97+
pub type IndexMap<T, S = DefaultHashBuilder> = indexmap::IndexMap<T, S>;
98+
pub type IndexSet<T, S = RandomState> = indexmap::IndexSet<T, S>;
99+
96100
/// Downcast an Arrow Array to a concrete type, return an `DataFusionError::Internal` if the cast is
97101
/// not possible. In normal usage of DataFusion the downcast should always succeed.
98102
///

datafusion/expr/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ datafusion-expr-common = { workspace = true }
4949
datafusion-functions-aggregate-common = { workspace = true }
5050
datafusion-functions-window-common = { workspace = true }
5151
datafusion-physical-expr-common = { workspace = true }
52-
indexmap = { workspace = true }
5352
paste = "^1.0"
5453
recursive = { workspace = true }
5554
serde_json = { workspace = true }

datafusion/expr/src/logical_plan/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@ use datafusion_common::file_options::file_type::FileType;
5454
use datafusion_common::{
5555
exec_err, get_target_functional_dependencies, internal_err, not_impl_err,
5656
plan_datafusion_err, plan_err, Column, DFSchema, DFSchemaRef, DataFusionError,
57-
FunctionalDependencies, Result, ScalarValue, TableReference, ToDFSchema,
57+
FunctionalDependencies, IndexSet, Result, ScalarValue, TableReference, ToDFSchema,
5858
UnnestOptions,
5959
};
6060
use datafusion_expr_common::type_coercion::binary::type_union_resolution;
61-
use indexmap::IndexSet;
6261

6362
/// Default table name for unnamed table
6463
pub const UNNAMED_TABLE: &str = "?table?";

datafusion/expr/src/logical_plan/plan.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ use datafusion_common::tree_node::{
5151
use datafusion_common::{
5252
aggregate_functional_dependencies, internal_err, plan_err, Column, Constraints,
5353
DFSchema, DFSchemaRef, DataFusionError, Dependency, FunctionalDependence,
54-
FunctionalDependencies, ParamValues, Result, ScalarValue, TableReference,
54+
FunctionalDependencies, IndexSet, ParamValues, Result, ScalarValue, TableReference,
5555
UnnestOptions,
5656
};
57-
use indexmap::IndexSet;
5857

5958
// backwards compatibility
6059
use crate::display::PgJsonVisitor;

datafusion/expr/src/utils.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ use datafusion_common::tree_node::{
3636
use datafusion_common::utils::get_at_indices;
3737
use datafusion_common::{
3838
internal_err, plan_datafusion_err, plan_err, Column, DFSchema, DFSchemaRef,
39-
DataFusionError, HashMap, Result, TableReference,
39+
DataFusionError, HashMap, IndexSet, Result, TableReference,
4040
};
4141

42-
use indexmap::IndexSet;
4342
use sqlparser::ast::{ExceptSelectItem, ExcludeSelectItem};
4443

4544
pub use datafusion_functions_aggregate_common::order::AggregateOrderSensitivity;

datafusion/optimizer/src/eliminate_duplicated_expr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020
use crate::optimizer::ApplyOrder;
2121
use crate::{OptimizerConfig, OptimizerRule};
2222
use datafusion_common::tree_node::Transformed;
23-
use datafusion_common::Result;
23+
use datafusion_common::{IndexSet, Result};
2424
use datafusion_expr::logical_plan::LogicalPlan;
2525
use datafusion_expr::{Aggregate, Expr, Sort, SortExpr};
26-
use indexmap::IndexSet;
2726
use std::hash::{Hash, Hasher};
2827
/// Optimization rule that eliminate duplicated expr.
2928
#[derive(Default, Debug)]

datafusion/optimizer/src/push_down_filter.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
//! [`PushDownFilter`] applies filters as early as possible
1919
20-
use indexmap::IndexSet;
2120
use std::collections::{HashMap, HashSet};
2221
use std::sync::Arc;
2322

@@ -27,7 +26,7 @@ use datafusion_common::tree_node::{
2726
Transformed, TransformedResult, TreeNode, TreeNodeRecursion,
2827
};
2928
use datafusion_common::{
30-
internal_err, plan_err, qualified_name, Column, DFSchema, Result,
29+
internal_err, plan_err, qualified_name, Column, DFSchema, IndexSet, Result,
3130
};
3231
use datafusion_expr::expr_rewriter::replace_col;
3332
use datafusion_expr::logical_plan::{Join, JoinType, LogicalPlan, TableScan, Union};

datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ use datafusion_common::{
3131
cast::{as_large_list_array, as_list_array},
3232
tree_node::{Transformed, TransformedResult, TreeNode, TreeNodeRewriter},
3333
};
34-
use datafusion_common::{internal_err, DFSchema, DataFusionError, Result, ScalarValue};
34+
use datafusion_common::{
35+
internal_err, DFSchema, DataFusionError, IndexSet, Result, ScalarValue,
36+
};
3537
use datafusion_expr::simplify::ExprSimplifyResult;
3638
use datafusion_expr::{
3739
and, lit, or, BinaryExpr, Case, ColumnarValue, Expr, Like, Operator, Volatility,
@@ -43,7 +45,6 @@ use datafusion_expr::{
4345
utils::{iter_conjunction, iter_conjunction_owned},
4446
};
4547
use datafusion_physical_expr::{create_physical_expr, execution_props::ExecutionProps};
46-
use indexmap::IndexSet;
4748

4849
use crate::analyzer::type_coercion::TypeCoercionRewriter;
4950
use crate::simplify_expressions::guarantees::GuaranteeRewriter;

datafusion/physical-expr/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ datafusion-functions-aggregate-common = { workspace = true }
4848
datafusion-physical-expr-common = { workspace = true }
4949
half = { workspace = true }
5050
hashbrown = { workspace = true }
51-
indexmap = { workspace = true }
5251
itertools = { workspace = true, features = ["use_std"] }
5352
log = { workspace = true }
5453
paste = "^1.0"

datafusion/physical-expr/src/equivalence/properties.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ use crate::{
3636

3737
use arrow_schema::{SchemaRef, SortOptions};
3838
use datafusion_common::tree_node::{Transformed, TransformedResult, TreeNode};
39-
use datafusion_common::{internal_err, plan_err, JoinSide, JoinType, Result};
39+
use datafusion_common::{
40+
internal_err, plan_err, IndexMap, IndexSet, JoinSide, JoinType, Result,
41+
};
4042
use datafusion_expr::interval_arithmetic::Interval;
4143
use datafusion_expr::sort_properties::{ExprProperties, SortProperties};
4244
use datafusion_physical_expr_common::utils::ExprPropertiesNode;
4345

44-
use indexmap::{IndexMap, IndexSet};
4546
use itertools::Itertools;
4647

4748
/// A `EquivalenceProperties` object stores information known about the output

datafusion/physical-expr/src/window/window_expr.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ use arrow::compute::SortOptions;
2828
use arrow::datatypes::Field;
2929
use arrow::record_batch::RecordBatch;
3030
use datafusion_common::utils::compare_rows;
31-
use datafusion_common::{internal_err, DataFusionError, Result, ScalarValue};
31+
use datafusion_common::{internal_err, DataFusionError, IndexMap, Result, ScalarValue};
3232
use datafusion_expr::window_state::{
3333
PartitionBatchState, WindowAggState, WindowFrameContext, WindowFrameStateGroups,
3434
};
3535
use datafusion_expr::{Accumulator, PartitionEvaluator, WindowFrame, WindowFrameBound};
3636

37-
use indexmap::IndexMap;
38-
3937
/// Common trait for [window function] implementations
4038
///
4139
/// # Aggregate Window Expressions

datafusion/physical-plan/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ datafusion-physical-expr-common = { workspace = true }
5757
futures = { workspace = true }
5858
half = { workspace = true }
5959
hashbrown = { workspace = true }
60-
indexmap = { workspace = true }
6160
itertools = { workspace = true, features = ["use_std"] }
6261
log = { workspace = true }
6362
once_cell = "1.18.0"

datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use datafusion_common::utils::{
5252
evaluate_partition_ranges, get_at_indices, get_row_at_idx,
5353
};
5454
use datafusion_common::{
55-
arrow_datafusion_err, exec_err, DataFusionError, HashMap, Result,
55+
arrow_datafusion_err, exec_err, DataFusionError, HashMap, IndexMap, Result,
5656
};
5757
use datafusion_execution::TaskContext;
5858
use datafusion_expr::window_state::{PartitionBatchState, WindowAggState};
@@ -65,7 +65,6 @@ use datafusion_physical_expr_common::sort_expr::{LexOrdering, LexRequirement};
6565
use futures::stream::Stream;
6666
use futures::{ready, StreamExt};
6767
use hashbrown::raw::RawTable;
68-
use indexmap::IndexMap;
6968
use log::debug;
7069

7170
/// Window execution plan

datafusion/sql/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ arrow-array = { workspace = true }
4646
arrow-schema = { workspace = true }
4747
datafusion-common = { workspace = true, default-features = true }
4848
datafusion-expr = { workspace = true }
49-
indexmap = { workspace = true }
5049
log = { workspace = true }
5150
recursive = { workspace = true }
5251
regex = { workspace = true }

datafusion/sql/src/select.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use crate::utils::{
2525
};
2626

2727
use datafusion_common::tree_node::{TreeNode, TreeNodeRecursion};
28-
use datafusion_common::{not_impl_err, plan_err, Result};
28+
use datafusion_common::{not_impl_err, plan_err, IndexMap, Result};
2929
use datafusion_common::{RecursionUnnestOption, UnnestOptions};
3030
use datafusion_expr::expr::{Alias, PlannedReplaceSelectItem, WildcardOptions};
3131
use datafusion_expr::expr_rewriter::{
@@ -38,7 +38,6 @@ use datafusion_expr::{
3838
qualified_wildcard_with_options, wildcard_with_options, Aggregate, Expr, Filter,
3939
GroupingSet, LogicalPlan, LogicalPlanBuilder, Partitioning,
4040
};
41-
use indexmap::IndexMap;
4241
use sqlparser::ast::{
4342
Distinct, Expr as SQLExpr, GroupByExpr, NamedWindowExpr, OrderByExpr,
4443
WildcardAdditionalOptions, WindowType,

datafusion/sql/src/unparser/utils.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ use std::{cmp::Ordering, sync::Arc, vec};
2020
use datafusion_common::{
2121
internal_err,
2222
tree_node::{Transformed, TransformedResult, TreeNode},
23-
Column, DataFusionError, Result, ScalarValue,
23+
Column, DataFusionError, IndexSet, Result, ScalarValue,
2424
};
2525
use datafusion_expr::{
2626
expr, utils::grouping_set_to_exprlist, Aggregate, Expr, LogicalPlan,
2727
LogicalPlanBuilder, Projection, SortExpr, Unnest, Window,
2828
};
29-
use indexmap::IndexSet;
3029
use sqlparser::ast;
3130

3231
use super::{

datafusion/sql/src/utils.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@ use datafusion_common::tree_node::{
2727
};
2828
use datafusion_common::{
2929
exec_err, internal_err, plan_err, Column, DFSchemaRef, DataFusionError, HashMap,
30-
Result, ScalarValue,
30+
IndexMap, Result, ScalarValue,
3131
};
3232
use datafusion_expr::builder::get_struct_unnested_columns;
3333
use datafusion_expr::expr::{Alias, GroupingSet, Unnest, WindowFunction};
3434
use datafusion_expr::utils::{expr_as_column_expr, find_column_exprs};
3535
use datafusion_expr::{
3636
col, expr_vec_fmt, ColumnUnnestList, Expr, ExprSchemable, LogicalPlan,
3737
};
38-
use indexmap::IndexMap;
3938
use sqlparser::ast::{Ident, Value};
4039

4140
/// Make a best-effort attempt at resolving all columns in the expression tree
@@ -618,13 +617,12 @@ mod tests {
618617

619618
use arrow::datatypes::{DataType as ArrowDataType, Field, Schema};
620619
use arrow_schema::Fields;
621-
use datafusion_common::{Column, DFSchema, Result};
620+
use datafusion_common::{Column, DFSchema, IndexMap, Result};
622621
use datafusion_expr::{
623622
col, lit, unnest, ColumnUnnestList, EmptyRelation, LogicalPlan,
624623
};
625624
use datafusion_functions::core::expr_ext::FieldAccessor;
626625
use datafusion_functions_aggregate::expr_fn::count;
627-
use indexmap::IndexMap;
628626

629627
use crate::utils::{resolve_positions_to_exprs, rewrite_recursive_unnest_bottom_up};
630628

0 commit comments

Comments
 (0)