Skip to content

Commit

Permalink
Merge commit 'e3af174efe14ce76ebf557bf258e7139bb5a7f9c' into chunchun…
Browse files Browse the repository at this point in the history
…/update-df-june-week-2-2
  • Loading branch information
appletreeisyellow committed Jun 24, 2024
2 parents 72beef6 + e3af174 commit fceab3c
Show file tree
Hide file tree
Showing 24 changed files with 649 additions and 196 deletions.
28 changes: 0 additions & 28 deletions .github_changelog_generator

This file was deleted.

36 changes: 18 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/apache/datafusion"
rust-version = "1.73"
version = "38.0.0"
version = "39.0.0"

[workspace.dependencies]
# We turn off default-features for some dependencies here so the workspaces which inherit them can
Expand Down Expand Up @@ -86,23 +86,23 @@ bytes = "1.4"
chrono = { version = "0.4.34", default-features = false }
ctor = "0.2.0"
dashmap = "5.5.0"
datafusion = { path = "datafusion/core", version = "38.0.0", default-features = false }
datafusion-common = { path = "datafusion/common", version = "38.0.0", default-features = false }
datafusion-common-runtime = { path = "datafusion/common-runtime", version = "38.0.0" }
datafusion-execution = { path = "datafusion/execution", version = "38.0.0" }
datafusion-expr = { path = "datafusion/expr", version = "38.0.0" }
datafusion-functions = { path = "datafusion/functions", version = "38.0.0" }
datafusion-functions-aggregate = { path = "datafusion/functions-aggregate", version = "38.0.0" }
datafusion-functions-array = { path = "datafusion/functions-array", version = "38.0.0" }
datafusion-optimizer = { path = "datafusion/optimizer", version = "38.0.0", default-features = false }
datafusion-physical-expr = { path = "datafusion/physical-expr", version = "38.0.0", default-features = false }
datafusion-physical-expr-common = { path = "datafusion/physical-expr-common", version = "38.0.0", default-features = false }
datafusion-physical-plan = { path = "datafusion/physical-plan", version = "38.0.0" }
datafusion-proto = { path = "datafusion/proto", version = "38.0.0" }
datafusion-proto-common = { path = "datafusion/proto-common", version = "38.0.0" }
datafusion-sql = { path = "datafusion/sql", version = "38.0.0" }
datafusion-sqllogictest = { path = "datafusion/sqllogictest", version = "38.0.0" }
datafusion-substrait = { path = "datafusion/substrait", version = "38.0.0" }
datafusion = { path = "datafusion/core", version = "39.0.0", default-features = false }
datafusion-common = { path = "datafusion/common", version = "39.0.0", default-features = false }
datafusion-common-runtime = { path = "datafusion/common-runtime", version = "39.0.0" }
datafusion-execution = { path = "datafusion/execution", version = "39.0.0" }
datafusion-expr = { path = "datafusion/expr", version = "39.0.0" }
datafusion-functions = { path = "datafusion/functions", version = "39.0.0" }
datafusion-functions-aggregate = { path = "datafusion/functions-aggregate", version = "39.0.0" }
datafusion-functions-array = { path = "datafusion/functions-array", version = "39.0.0" }
datafusion-optimizer = { path = "datafusion/optimizer", version = "39.0.0", default-features = false }
datafusion-physical-expr = { path = "datafusion/physical-expr", version = "39.0.0", default-features = false }
datafusion-physical-expr-common = { path = "datafusion/physical-expr-common", version = "39.0.0", default-features = false }
datafusion-physical-plan = { path = "datafusion/physical-plan", version = "39.0.0" }
datafusion-proto = { path = "datafusion/proto", version = "39.0.0" }
datafusion-proto-common = { path = "datafusion/proto-common", version = "39.0.0" }
datafusion-sql = { path = "datafusion/sql", version = "39.0.0" }
datafusion-sqllogictest = { path = "datafusion/sqllogictest", version = "39.0.0" }
datafusion-substrait = { path = "datafusion/substrait", version = "39.0.0" }
doc-comment = "0.3"
env_logger = "0.11"
futures = "0.3"
Expand Down
33 changes: 17 additions & 16 deletions datafusion-cli/Cargo.lock

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

4 changes: 2 additions & 2 deletions datafusion-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[package]
name = "datafusion-cli"
description = "Command Line Client for DataFusion query engine."
version = "38.0.0"
version = "39.0.0"
authors = ["Apache DataFusion <[email protected]>"]
edition = "2021"
keywords = ["arrow", "datafusion", "query", "sql"]
Expand All @@ -35,7 +35,7 @@ async-trait = "0.1.41"
aws-config = "0.55"
aws-credential-types = "0.55"
clap = { version = "3", features = ["derive", "cargo"] }
datafusion = { path = "../datafusion/core", version = "38.0.0", features = [
datafusion = { path = "../datafusion/core", version = "39.0.0", features = [
"avro",
"crypto_expressions",
"datetime_expressions",
Expand Down
39 changes: 1 addition & 38 deletions datafusion/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,4 @@

# Changelog

- [38.0.0](../dev/changelog/38.0.0.md)
- [37.1.0](../dev/changelog/37.1.0.md)
- [37.0.0](../dev/changelog/37.0.0.md)
- [36.0.0](../dev/changelog/36.0.0.md)
- [35.0.0](../dev/changelog/35.0.0.md)
- [34.0.0](../dev/changelog/34.0.0.md)
- [33.0.0](../dev/changelog/33.0.0.md)
- [32.0.0](../dev/changelog/32.0.0.md)
- [31.0.0](../dev/changelog/31.0.0.md)
- [30.0.0](../dev/changelog/30.0.0.md)
- [29.0.0](../dev/changelog/29.0.0.md)
- [28.0.0](../dev/changelog/28.0.0.md)
- [27.0.0](../dev/changelog/27.0.0.md)
- [26.0.0](../dev/changelog/26.0.0.md)
- [25.0.0](../dev/changelog/25.0.0.md)
- [24.0.0](../dev/changelog/24.0.0.md)
- [23.0.0](../dev/changelog/23.0.0.md)
- [22.0.0](../dev/changelog/22.0.0.md)
- [21.1.0](../dev/changelog/21.1.0.md)
- [21.0.0](../dev/changelog/21.0.0.md)
- [20.0.0](../dev/changelog/20.0.0.md)
- [19.0.0](../dev/changelog/19.0.0.md)
- [18.0.0](../dev/changelog/18.0.0.md)
- [17.0.0](../dev/changelog/17.0.0.md)
- [16.1.0](../dev/changelog/16.1.0.md)
- [16.0.0](../dev/changelog/16.0.0.md)
- [15.0.0](../dev/changelog/15.0.0.md)
- [14.0.0](../dev/changelog/14.0.0.md)
- [13.0.0](../dev/changelog/13.0.0.md)
- [12.0.0](../dev/changelog/12.0.0.md)
- [11.0.0](../dev/changelog/11.0.0.md)
- [10.0.0](../dev/changelog/10.0.0.md)
- [9.0.0](../dev/changelog/9.0.0.md)
- [8.0.0](../dev/changelog/8.0.0.md)
- [7.1.0](../dev/changelog/7.1.0.md)
- [7.0.0](../dev/changelog/7.0.0.md)
- [6.0.0](../dev/changelog/6.0.0.md)
- [5.0.0](../dev/changelog/5.0.0.md)
Change logs for each release can be found [here](https://github.com/apache/datafusion/tree/main/dev/changelog).
14 changes: 0 additions & 14 deletions datafusion/expr/src/expr_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,6 @@ pub fn max(expr: Expr) -> Expr {
))
}

/// Create an expression to represent the sum() aggregate function
///
/// TODO: Remove this function and use `sum` from `datafusion_functions_aggregate::expr_fn` instead
pub fn sum(expr: Expr) -> Expr {
Expr::AggregateFunction(AggregateFunction::new(
aggregate_function::AggregateFunction::Sum,
vec![expr],
false,
None,
None,
None,
))
}

/// Create an expression to represent the array_agg() aggregate function
pub fn array_agg(expr: Expr) -> Expr {
Expr::AggregateFunction(AggregateFunction::new(
Expand Down
54 changes: 1 addition & 53 deletions datafusion/expr/src/logical_plan/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@ pub fn unnest_with_options(
mod tests {
use super::*;
use crate::logical_plan::StringifiedPlan;
use crate::{col, expr, expr_fn::exists, in_subquery, lit, scalar_subquery, sum};
use crate::{col, expr, expr_fn::exists, in_subquery, lit, scalar_subquery};

use datafusion_common::SchemaError;

Expand Down Expand Up @@ -1775,28 +1775,6 @@ mod tests {
);
}

#[test]
fn plan_builder_aggregate() -> Result<()> {
let plan =
table_scan(Some("employee_csv"), &employee_schema(), Some(vec![3, 4]))?
.aggregate(
vec![col("state")],
vec![sum(col("salary")).alias("total_salary")],
)?
.project(vec![col("state"), col("total_salary")])?
.limit(2, Some(10))?
.build()?;

let expected = "Limit: skip=2, fetch=10\
\n Projection: employee_csv.state, total_salary\
\n Aggregate: groupBy=[[employee_csv.state]], aggr=[[SUM(employee_csv.salary) AS total_salary]]\
\n TableScan: employee_csv projection=[state, salary]";

assert_eq!(expected, format!("{plan:?}"));

Ok(())
}

#[test]
fn plan_builder_sort() -> Result<()> {
let plan =
Expand Down Expand Up @@ -2037,36 +2015,6 @@ mod tests {
}
}

#[test]
fn aggregate_non_unique_names() -> Result<()> {
let plan = table_scan(
Some("employee_csv"),
&employee_schema(),
// project state and salary by column index
Some(vec![3, 4]),
)?
// two columns with the same name => error
.aggregate(vec![col("state")], vec![sum(col("salary")).alias("state")]);

match plan {
Err(DataFusionError::SchemaError(
SchemaError::AmbiguousReference {
field:
Column {
relation: Some(TableReference::Bare { table }),
name,
},
},
_,
)) => {
assert_eq!(*"employee_csv", *table);
assert_eq!("state", &name);
Ok(())
}
_ => plan_err!("Plan should have returned an DataFusionError::SchemaError"),
}
}

fn employee_schema() -> Schema {
Schema::new(vec![
Field::new("id", DataType::Int32, false),
Expand Down
1 change: 1 addition & 0 deletions datafusion/optimizer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ hashbrown = { workspace = true }
indexmap = { workspace = true }
itertools = { workspace = true }
log = { workspace = true }
paste = "1.0.14"
regex-syntax = "0.8.0"

[dev-dependencies]
Expand Down
Loading

0 comments on commit fceab3c

Please sign in to comment.