Skip to content

Commit

Permalink
Remove RowAccumulators and datafusion-row (#6968)
Browse files Browse the repository at this point in the history
* Remove `RowAccumulators`

* Remove `datafusion-row`

* Update datafusion cli

* update depes
  • Loading branch information
alamb authored Jul 20, 2023
1 parent eb9a702 commit 7e2cca8
Show file tree
Hide file tree
Showing 26 changed files with 101 additions and 3,327 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

[workspace]
exclude = ["datafusion-cli"]
members = ["datafusion/common", "datafusion/core", "datafusion/expr", "datafusion/execution", "datafusion/optimizer", "datafusion/physical-expr", "datafusion/proto", "datafusion/proto/gen", "datafusion/row", "datafusion/sql", "datafusion/substrait", "datafusion-examples", "test-utils", "benchmarks",
members = ["datafusion/common", "datafusion/core", "datafusion/expr", "datafusion/execution", "datafusion/optimizer", "datafusion/physical-expr", "datafusion/proto", "datafusion/proto/gen", "datafusion/sql", "datafusion/substrait", "datafusion-examples", "test-utils", "benchmarks",
]
resolver = "2"

Expand Down
94 changes: 41 additions & 53 deletions datafusion-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion datafusion/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ datafusion-execution = { path = "../execution", version = "27.0.0" }
datafusion-expr = { path = "../expr", version = "27.0.0" }
datafusion-optimizer = { path = "../optimizer", version = "27.0.0", default-features = false }
datafusion-physical-expr = { path = "../physical-expr", version = "27.0.0", default-features = false }
datafusion-row = { path = "../row", version = "27.0.0" }
datafusion-sql = { path = "../sql", version = "27.0.0" }
flate2 = { version = "1.0.24", optional = true }
futures = "0.3"
Expand Down
6 changes: 0 additions & 6 deletions datafusion/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@
//! * [datafusion_execution]: State and structures needed for execution
//! * [datafusion_optimizer]: [`OptimizerRule`]s and [`AnalyzerRule`]s
//! * [datafusion_physical_expr]: [`PhysicalExpr`] and related expressions
//! * [datafusion_row]: Row based representation
//! * [datafusion_sql]: SQL planner ([`SqlToRel`])
//!
//! [sqlparser]: https://docs.rs/sqlparser/latest/sqlparser
Expand Down Expand Up @@ -468,11 +467,6 @@ pub mod physical_expr {
pub use datafusion_physical_expr::*;
}

/// re-export of [`datafusion_row`] crate
pub mod row {
pub use datafusion_row::*;
}

/// re-export of [`datafusion_sql`] crate
pub mod sql {
pub use datafusion_sql::*;
Expand Down
17 changes: 0 additions & 17 deletions datafusion/core/src/physical_plan/aggregates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ use datafusion_common::{DataFusionError, Result};
use datafusion_execution::TaskContext;
use datafusion_expr::Accumulator;
use datafusion_physical_expr::{
aggregate::row_accumulator::RowAccumulator,
equivalence::project_equivalence_properties,
expressions::{Avg, CastExpr, Column, Sum},
normalize_out_expr_with_columns_map, reverse_order_bys,
Expand Down Expand Up @@ -1093,7 +1092,6 @@ fn merge_expressions(
}

pub(crate) type AccumulatorItem = Box<dyn Accumulator>;
pub(crate) type RowAccumulatorItem = Box<dyn RowAccumulator>;

fn create_accumulators(
aggr_expr: &[Arc<dyn AggregateExpr>],
Expand All @@ -1104,21 +1102,6 @@ fn create_accumulators(
.collect::<Result<Vec<_>>>()
}

#[allow(dead_code)]
fn create_row_accumulators(
aggr_expr: &[Arc<dyn AggregateExpr>],
) -> Result<Vec<RowAccumulatorItem>> {
let mut state_index = 0;
aggr_expr
.iter()
.map(|expr| {
let result = expr.create_row_accumulator(state_index);
state_index += expr.state_fields().unwrap().len();
result
})
.collect::<Result<Vec<_>>>()
}

/// returns a vector of ArrayRefs, where each entry corresponds to either the
/// final value (mode = Final, FinalPartitioned and Single) or states (mode = Partial)
fn finalize_aggregation(
Expand Down
1 change: 0 additions & 1 deletion datafusion/core/src/physical_plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ use arrow::record_batch::RecordBatch;
use datafusion_common::utils::DataPtr;
pub use datafusion_expr::Accumulator;
pub use datafusion_expr::ColumnarValue;
pub use datafusion_physical_expr::aggregate::row_accumulator::RowAccumulator;
use datafusion_physical_expr::equivalence::OrderingEquivalenceProperties;
pub use display::{DefaultDisplay, DisplayAs, DisplayFormatType, VerboseDisplay};
use futures::stream::{Stream, TryStreamExt};
Expand Down
Loading

0 comments on commit 7e2cca8

Please sign in to comment.