Skip to content

48.0.1 #16755

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

Draft
wants to merge 82 commits into
base: main
Choose a base branch
from
Draft

48.0.1 #16755

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9707a8a
bump version and generate changelog
andygrove Nov 5, 2024
88f58bf
bump version and generate changelog
andygrove Nov 5, 2024
2d5364e
Downgrade tonic
matthewmturner Dec 23, 2024
2c35f17
[bug]: Fix wrong order by removal from plan (#13497)
akurmustafa Nov 24, 2024
608ee58
Correct return type for initcap scalar function with utf8view (#13909…
alamb Dec 28, 2024
3cc3fca
Update CHANGELOG
alamb Dec 28, 2024
5383d30
enforce_distribution: fix for limits getting lost
Max-Meldrum Dec 30, 2024
13f6aca
set default-features=false for datafusion in proto crate
Max-Meldrum Jan 7, 2025
d357c7a
Adding node_id patch to our fork
emgeee Sep 11, 2024
cbd3dbc
Changes to make streaming work
ameyc May 2, 2024
deecef1
only output node_id in display if it exists
Max-Meldrum Dec 11, 2024
57bf8d6
include projection in FilterExec::with_node_id
Max-Meldrum Jan 7, 2025
c431f0f
add missing with_fetch calls to with_node_id method
Max-Meldrum Jan 7, 2025
fa581d0
rework SortExec::with_node_id to not drop preserve_partitioning
Max-Meldrum Jan 8, 2025
555ef6b
set schema_force_view_types to false in ParquetOptions
Max-Meldrum Jan 9, 2025
0e3c9e0
Revert "enforce_distribution: fix for limits getting lost"
suremarc Jan 14, 2025
a4153bf
update sqllogictests after disabling view types
suremarc Jan 14, 2025
8ae4a95
fix fetch missed in EnforceDistribution
xudong963 Jan 15, 2025
1ae2702
fix enforcesorting missing fetch
xudong963 Jan 17, 2025
38f39f5
fix more fetch missing in enforcesorting
xudong963 Jan 17, 2025
f7740af
fix: fetch is missed in the EnforceSorting (#14192)
xudong963 Jan 20, 2025
22473d9
fix remaining test issues regarding with_node_id
Max-Meldrum Jan 23, 2025
f0f6e81
use new_utf8 instead of new_utf8view in page_pruning test as we have …
Max-Meldrum Jan 23, 2025
f3e7004
Expose more components from sqllogictest (#14249)
xudong963 Jan 23, 2025
c976a89
Extract useful methods from sqllogictest bin (#14267)
xudong963 Jan 25, 2025
ffff7a1
expose df sqllogictest error
xudong963 Jan 27, 2025
63bad11
update sqllogictest
xudong963 Jan 27, 2025
e3ea7d1
chore: Upgrade to `arrow`/`parquet` `54.1.0` and fix clippy/ci (#144…
alamb Feb 3, 2025
8f10fdf
Fix join type coercion (#14387) (#14454)
alamb Feb 3, 2025
755b26a
Support `Utf8View` to `numeric` coercion (#14377) (#14455)
alamb Feb 3, 2025
9d287bd
Update REGEXP_MATCH scalar function to support Utf8View (#14449) (#14…
alamb Feb 3, 2025
6146600
Fix regression list Type Coercion List with inner type struct which h…
alamb Feb 3, 2025
26058ac
Update changelog (#14460)
alamb Feb 3, 2025
6e1e0d1
fix datafusion-cli
xudong963 Feb 6, 2025
af26638
missing fetch after removing SPM
xudong963 Feb 10, 2025
d290676
Merge remote-tracking branch 'upstream/branch-44' into branch-44-toni…
xudong963 Feb 10, 2025
d518b51
update cargo toml
xudong963 Feb 10, 2025
e5431f1
make new_group_values public
xudong963 Feb 10, 2025
c103d08
cherry-pick upstream/14569
xudong963 Feb 12, 2025
e9fb062
fix EnforceDistribution
xudong963 Feb 24, 2025
51d0dea
Merge remote-tracking branch 'upstream/branch-45' into branch-44-toni…
xudong963 Feb 24, 2025
ee7b658
Merge remote-tracking branch 'upstream/branch-45'(with our fixes)
xudong963 Feb 24, 2025
3766da9
downgrade tonic
xudong963 Feb 24, 2025
2b5cec2
cherry-pick upstream/14569
xudong963 Feb 24, 2025
08b3ce0
public more parquet components
xudong963 Feb 28, 2025
8b3cd7b
Do not swap with projection when file is partitioned (#14956) (#14964)
alamb Mar 2, 2025
76d833a
Improve documentation for `DataSourceExec`, `FileScanConfig`, `DataSo…
alamb Mar 2, 2025
b494e97
Deprecate `Expr::Wildcard` (#14959) (#14976)
xudong963 Mar 3, 2025
65c8560
[branch-46] Update changelog for backports to 46.0.0 (#14977)
xudong963 Mar 3, 2025
ec4862f
Add note about upgrade guide into the release notes (#14979)
alamb Mar 3, 2025
d5ca830
Fix verification script and extended tests due to `rustup` changes (#…
alamb Mar 4, 2025
1c92803
upgrade tonic
xudong963 Mar 13, 2025
112e9eb
Update ring to v0.17.13 (#15063) (#15228)
alamb Mar 14, 2025
0877c99
Fix broken `serde` feature (#15124) (#15227)
alamb Mar 14, 2025
048a125
[branch-46] Fix wasm32 build on version 46 (#15229)
alamb Mar 14, 2025
68f2903
Update version to 46.0.1, add CHANGELOG (#15243)
xudong963 Mar 15, 2025
b8699d9
Merge remote-tracking branch 'upstream/branch-46' into branch-46-stream
xudong963 Mar 20, 2025
2e5b5e2
fix with_node_id and clippy
xudong963 Mar 20, 2025
3be582f
Fix invalid schema for unions in ViewTables (#15135)
Friede80 Mar 16, 2025
a28f2cd
Fix enforce_distribution and enforce_sorting missing fetch
xudong963 Apr 14, 2025
e443304
Final release note touchups (#15740)
alamb Apr 16, 2025
d0b0211
Merge remote-tracking branch 'upstream/branch-47' into branch-47-stream
xudong963 Apr 21, 2025
fe4a4ca
Upgrade DF47
xudong963 Apr 21, 2025
dfb339d
Fix: fetch is missing in plan_with_order_breaking_variants method
xudong963 Apr 23, 2025
656092e
Add fast path for optimize_projection (#15746)
xudong963 Apr 18, 2025
d2b8c15
Improve `simplify_expressions` rule (#15735)
xudong963 Apr 19, 2025
2d1062f
Speed up `optimize_projection` (#15787)
xudong963 Apr 23, 2025
738816d
Support inferring new predicates to push down
xudong963 Apr 24, 2025
d029200
Fix: `build_predicate_expression` method doesn't process `false` expr…
xudong963 May 12, 2025
378ce3b
Revert use file schema in parquet pruning (#16086)
adriangb May 21, 2025
c76c1f0
fix: [branch-48] Revert "Improve performance of constant aggregate wi…
andygrove Jun 6, 2025
b5dfdbe
feat: add metadata to literal expressions (#16170) (#16315)
andygrove Jun 7, 2025
33a32d4
[branch-48] Update CHANGELOG for latest 48.0.0 release (#16314)
alamb Jun 7, 2025
a13a6fe
Simplify filter predicates
xudong963 Jun 10, 2025
88c42dc
Merge remote-tracking branch 'upstream/branch-48' into branch-48-stream
xudong963 Jun 24, 2025
e5e5c48
Upgrade DF48
xudong963 Jun 24, 2025
7b31676
Fix parquet filter_pushdown: respect parquet filter pushdown config i…
alamb Jul 3, 2025
d43ddf1
[branch-48] Set the default value of datafusion.execution.collect_sta…
blaginin Jul 4, 2025
bcb8dc5
fix: column indices in FFI partition evaluator (#16480) (#16657)
alamb Jul 4, 2025
1dbf5c5
[branch-48] Prepare 48.0.1 ad CHANGELOG (#16679)
alamb Jul 4, 2025
6851d8e
Add the missing equivalence info for filter pushdown
liamzwbao Jul 4, 2025
72a7c7b
Merge tag '48.0.1' into 48.0.1
matthewmturner Jul 12, 2025
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
707 changes: 374 additions & 333 deletions Cargo.lock

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ repository = "https://github.com/apache/datafusion"
# Define Minimum Supported Rust Version (MSRV)
rust-version = "1.82.0"
# Define DataFusion version
version = "48.0.0"
version = "48.0.1"

[workspace.dependencies]
# We turn off default-features for some dependencies here so the workspaces which inherit them can
Expand Down Expand Up @@ -108,39 +108,39 @@ chrono = { version = "0.4.41", default-features = false }
criterion = "0.5.1"
ctor = "0.4.0"
dashmap = "6.0.1"
datafusion = { path = "datafusion/core", version = "48.0.0", default-features = false }
datafusion-catalog = { path = "datafusion/catalog", version = "48.0.0" }
datafusion-catalog-listing = { path = "datafusion/catalog-listing", version = "48.0.0" }
datafusion-common = { path = "datafusion/common", version = "48.0.0", default-features = false }
datafusion-common-runtime = { path = "datafusion/common-runtime", version = "48.0.0" }
datafusion-datasource = { path = "datafusion/datasource", version = "48.0.0", default-features = false }
datafusion-datasource-avro = { path = "datafusion/datasource-avro", version = "48.0.0", default-features = false }
datafusion-datasource-csv = { path = "datafusion/datasource-csv", version = "48.0.0", default-features = false }
datafusion-datasource-json = { path = "datafusion/datasource-json", version = "48.0.0", default-features = false }
datafusion-datasource-parquet = { path = "datafusion/datasource-parquet", version = "48.0.0", default-features = false }
datafusion-doc = { path = "datafusion/doc", version = "48.0.0" }
datafusion-execution = { path = "datafusion/execution", version = "48.0.0" }
datafusion-expr = { path = "datafusion/expr", version = "48.0.0" }
datafusion-expr-common = { path = "datafusion/expr-common", version = "48.0.0" }
datafusion-ffi = { path = "datafusion/ffi", version = "48.0.0" }
datafusion-functions = { path = "datafusion/functions", version = "48.0.0" }
datafusion-functions-aggregate = { path = "datafusion/functions-aggregate", version = "48.0.0" }
datafusion-functions-aggregate-common = { path = "datafusion/functions-aggregate-common", version = "48.0.0" }
datafusion-functions-nested = { path = "datafusion/functions-nested", version = "48.0.0" }
datafusion-functions-table = { path = "datafusion/functions-table", version = "48.0.0" }
datafusion-functions-window = { path = "datafusion/functions-window", version = "48.0.0" }
datafusion-functions-window-common = { path = "datafusion/functions-window-common", version = "48.0.0" }
datafusion-macros = { path = "datafusion/macros", version = "48.0.0" }
datafusion-optimizer = { path = "datafusion/optimizer", version = "48.0.0", default-features = false }
datafusion-physical-expr = { path = "datafusion/physical-expr", version = "48.0.0", default-features = false }
datafusion-physical-expr-common = { path = "datafusion/physical-expr-common", version = "48.0.0", default-features = false }
datafusion-physical-optimizer = { path = "datafusion/physical-optimizer", version = "48.0.0" }
datafusion-physical-plan = { path = "datafusion/physical-plan", version = "48.0.0" }
datafusion-proto = { path = "datafusion/proto", version = "48.0.0" }
datafusion-proto-common = { path = "datafusion/proto-common", version = "48.0.0" }
datafusion-session = { path = "datafusion/session", version = "48.0.0" }
datafusion-spark = { path = "datafusion/spark", version = "48.0.0" }
datafusion-sql = { path = "datafusion/sql", version = "48.0.0" }
datafusion = { path = "datafusion/core", version = "48.0.1", default-features = false }
datafusion-catalog = { path = "datafusion/catalog", version = "48.0.1" }
datafusion-catalog-listing = { path = "datafusion/catalog-listing", version = "48.0.1" }
datafusion-common = { path = "datafusion/common", version = "48.0.1", default-features = false }
datafusion-common-runtime = { path = "datafusion/common-runtime", version = "48.0.1" }
datafusion-datasource = { path = "datafusion/datasource", version = "48.0.1", default-features = false }
datafusion-datasource-avro = { path = "datafusion/datasource-avro", version = "48.0.1", default-features = false }
datafusion-datasource-csv = { path = "datafusion/datasource-csv", version = "48.0.1", default-features = false }
datafusion-datasource-json = { path = "datafusion/datasource-json", version = "48.0.1", default-features = false }
datafusion-datasource-parquet = { path = "datafusion/datasource-parquet", version = "48.0.1", default-features = false }
datafusion-doc = { path = "datafusion/doc", version = "48.0.1" }
datafusion-execution = { path = "datafusion/execution", version = "48.0.1" }
datafusion-expr = { path = "datafusion/expr", version = "48.0.1" }
datafusion-expr-common = { path = "datafusion/expr-common", version = "48.0.1" }
datafusion-ffi = { path = "datafusion/ffi", version = "48.0.1" }
datafusion-functions = { path = "datafusion/functions", version = "48.0.1" }
datafusion-functions-aggregate = { path = "datafusion/functions-aggregate", version = "48.0.1" }
datafusion-functions-aggregate-common = { path = "datafusion/functions-aggregate-common", version = "48.0.1" }
datafusion-functions-nested = { path = "datafusion/functions-nested", version = "48.0.1" }
datafusion-functions-table = { path = "datafusion/functions-table", version = "48.0.1" }
datafusion-functions-window = { path = "datafusion/functions-window", version = "48.0.1" }
datafusion-functions-window-common = { path = "datafusion/functions-window-common", version = "48.0.1" }
datafusion-macros = { path = "datafusion/macros", version = "48.0.1" }
datafusion-optimizer = { path = "datafusion/optimizer", version = "48.0.1", default-features = false }
datafusion-physical-expr = { path = "datafusion/physical-expr", version = "48.0.1", default-features = false }
datafusion-physical-expr-common = { path = "datafusion/physical-expr-common", version = "48.0.1", default-features = false }
datafusion-physical-optimizer = { path = "datafusion/physical-optimizer", version = "48.0.1" }
datafusion-physical-plan = { path = "datafusion/physical-plan", version = "48.0.1" }
datafusion-proto = { path = "datafusion/proto", version = "48.0.1" }
datafusion-proto-common = { path = "datafusion/proto-common", version = "48.0.1" }
datafusion-session = { path = "datafusion/session", version = "48.0.1" }
datafusion-spark = { path = "datafusion/spark", version = "48.0.1" }
datafusion-sql = { path = "datafusion/sql", version = "48.0.1" }
doc-comment = "0.3"
env_logger = "0.11"
futures = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion datafusion-cli/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ pub struct ParquetMetadataFunc {}
impl TableFunctionImpl for ParquetMetadataFunc {
fn call(&self, exprs: &[Expr]) -> Result<Arc<dyn TableProvider>> {
let filename = match exprs.first() {
Some(Expr::Literal(ScalarValue::Utf8(Some(s)))) => s, // single quote: parquet_metadata('x.parquet')
Some(Expr::Literal(ScalarValue::Utf8(Some(s)), _)) => s, // single quote: parquet_metadata('x.parquet')
Some(Expr::Column(Column { name, .. })) => name, // double quote: parquet_metadata("x.parquet")
_ => {
return plan_err!(
Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/examples/expr_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async fn main() -> Result<()> {
let expr2 = Expr::BinaryExpr(BinaryExpr::new(
Box::new(col("a")),
Operator::Plus,
Box::new(Expr::Literal(ScalarValue::Int32(Some(5)))),
Box::new(Expr::Literal(ScalarValue::Int32(Some(5)), None)),
));
assert_eq!(expr, expr2);

Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/examples/optimizer_rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ fn is_binary_eq(binary_expr: &BinaryExpr) -> bool {

/// Return true if the expression is a literal or column reference
fn is_lit_or_col(expr: &Expr) -> bool {
matches!(expr, Expr::Column(_) | Expr::Literal(_))
matches!(expr, Expr::Column(_) | Expr::Literal(_, _))
}

/// A simple user defined filter function
Expand Down
26 changes: 26 additions & 0 deletions datafusion-examples/examples/planner_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,35 @@ async fn to_physical_plan_in_one_api_demo(
displayable(physical_plan.as_ref()).indent(false)
);

let traversal = extract_node_ids_from_execution_plan_tree(physical_plan.as_ref());
let expected_traversal = vec![
Some(0),
Some(1),
Some(2),
Some(3),
Some(4),
Some(5),
Some(6),
Some(7),
Some(8),
Some(9),
];
assert_eq!(expected_traversal, traversal);
Ok(())
}

fn extract_node_ids_from_execution_plan_tree(
physical_plan: &dyn ExecutionPlan,
) -> Vec<Option<usize>> {
let mut traversed_nodes: Vec<Option<usize>> = vec![];
for child in physical_plan.children() {
let node_ids = extract_node_ids_from_execution_plan_tree(child.as_ref());
traversed_nodes.extend(node_ids);
}
traversed_nodes.push(physical_plan.properties().node_id());
traversed_nodes
}

/// Converts a logical plan into a physical plan by utilizing the analyzer,
/// optimizer, and query planner APIs separately. This flavor gives more
/// control over the planning process.
Expand Down
5 changes: 3 additions & 2 deletions datafusion-examples/examples/simple_udtf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ struct LocalCsvTableFunc {}

impl TableFunctionImpl for LocalCsvTableFunc {
fn call(&self, exprs: &[Expr]) -> Result<Arc<dyn TableProvider>> {
let Some(Expr::Literal(ScalarValue::Utf8(Some(ref path)))) = exprs.first() else {
let Some(Expr::Literal(ScalarValue::Utf8(Some(ref path)), _)) = exprs.first()
else {
return plan_err!("read_csv requires at least one string argument");
};

Expand All @@ -145,7 +146,7 @@ impl TableFunctionImpl for LocalCsvTableFunc {
let info = SimplifyContext::new(&execution_props);
let expr = ExprSimplifier::new(info).simplify(expr.clone())?;

if let Expr::Literal(ScalarValue::Int64(Some(limit))) = expr {
if let Expr::Literal(ScalarValue::Int64(Some(limit)), _) = expr {
Ok(limit as usize)
} else {
plan_err!("Limit must be an integer")
Expand Down
15 changes: 8 additions & 7 deletions datafusion/catalog-listing/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub fn expr_applicable_for_cols(col_names: &[&str], expr: &Expr) -> bool {
Ok(TreeNodeRecursion::Stop)
}
}
Expr::Literal(_)
Expr::Literal(_, _)
| Expr::Alias(_)
| Expr::OuterReferenceColumn(_, _)
| Expr::ScalarVariable(_, _)
Expand Down Expand Up @@ -346,8 +346,8 @@ fn populate_partition_values<'a>(
{
match op {
Operator::Eq => match (left.as_ref(), right.as_ref()) {
(Expr::Column(Column { ref name, .. }), Expr::Literal(val))
| (Expr::Literal(val), Expr::Column(Column { ref name, .. })) => {
(Expr::Column(Column { ref name, .. }), Expr::Literal(val, _))
| (Expr::Literal(val, _), Expr::Column(Column { ref name, .. })) => {
if partition_values
.insert(name, PartitionValue::Single(val.to_string()))
.is_some()
Expand Down Expand Up @@ -984,7 +984,7 @@ mod tests {
assert_eq!(
evaluate_partition_prefix(
partitions,
&[col("a").eq(Expr::Literal(ScalarValue::Date32(Some(3))))],
&[col("a").eq(Expr::Literal(ScalarValue::Date32(Some(3)), None))],
),
Some(Path::from("a=1970-01-04")),
);
Expand All @@ -993,9 +993,10 @@ mod tests {
assert_eq!(
evaluate_partition_prefix(
partitions,
&[col("a").eq(Expr::Literal(ScalarValue::Date64(Some(
4 * 24 * 60 * 60 * 1000
)))),],
&[col("a").eq(Expr::Literal(
ScalarValue::Date64(Some(4 * 24 * 60 * 60 * 1000)),
None
)),],
),
Some(Path::from("a=1970-01-05")),
);
Expand Down
6 changes: 3 additions & 3 deletions datafusion/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ config_namespace! {

/// Should DataFusion collect statistics when first creating a table.
/// Has no effect after the table is created. Applies to the default
/// `ListingTableProvider` in DataFusion. Defaults to false.
pub collect_statistics: bool, default = false
/// `ListingTableProvider` in DataFusion. Defaults to true.
pub collect_statistics: bool, default = true

/// Number of partitions for query execution. Increasing partitions can increase
/// concurrency.
Expand Down Expand Up @@ -457,7 +457,7 @@ config_namespace! {

/// (reading) If true, parquet reader will read columns of `Utf8/Utf8Large` with `Utf8View`,
/// and `Binary/BinaryLarge` with `BinaryView`.
pub schema_force_view_types: bool, default = true
pub schema_force_view_types: bool, default = false

/// (reading) If true, parquet reader will read columns of
/// `Binary/LargeBinary` with `Utf8`, and `BinaryView` with `Utf8View`.
Expand Down
7 changes: 5 additions & 2 deletions datafusion/core/benches/map_query_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ fn criterion_benchmark(c: &mut Criterion) {
let mut value_buffer = Vec::new();

for i in 0..1000 {
key_buffer.push(Expr::Literal(ScalarValue::Utf8(Some(keys[i].clone()))));
value_buffer.push(Expr::Literal(ScalarValue::Int32(Some(values[i]))));
key_buffer.push(Expr::Literal(
ScalarValue::Utf8(Some(keys[i].clone())),
None,
));
value_buffer.push(Expr::Literal(ScalarValue::Int32(Some(values[i])), None));
}
c.bench_function("map_1000_1", |b| {
b.iter(|| {
Expand Down
5 changes: 4 additions & 1 deletion datafusion/core/src/dataframe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,10 @@ impl DataFrame {
/// ```
pub async fn count(self) -> Result<usize> {
let rows = self
.aggregate(vec![], vec![count(Expr::Literal(COUNT_STAR_EXPANSION))])?
.aggregate(
vec![],
vec![count(Expr::Literal(COUNT_STAR_EXPANSION, None))],
)?
.collect()
.await?;
let len = *rows
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 @@ -2230,7 +2230,7 @@ mod tests {
let filter_predicate = Expr::BinaryExpr(BinaryExpr::new(
Box::new(Expr::Column("column1".into())),
Operator::GtEq,
Box::new(Expr::Literal(ScalarValue::Int32(Some(0)))),
Box::new(Expr::Literal(ScalarValue::Int32(Some(0)), None)),
));

// Create a new batch of data to insert into the table
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/execution/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ impl SessionContext {
let mut params: Vec<ScalarValue> = parameters
.into_iter()
.map(|e| match e {
Expr::Literal(scalar) => Ok(scalar),
Expr::Literal(scalar, _) => Ok(scalar),
_ => not_impl_err!("Unsupported parameter type: {}", e),
})
.collect::<Result<_>>()?;
Expand Down
27 changes: 13 additions & 14 deletions datafusion/core/src/execution/context/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ impl SessionContext {
///
/// # Note: Statistics
///
/// NOTE: by default, statistics are not collected when reading the Parquet
/// files as this can slow down the initial DataFrame creation. However,
/// collecting statistics can greatly accelerate queries with certain
/// filters.
/// NOTE: by default, statistics are collected when reading the Parquet
/// files This can slow down the initial DataFrame creation while
/// greatly accelerating queries with certain filters.
///
/// To enable collect statistics, set the [config option]
/// `datafusion.execution.collect_statistics` to `true`. See
/// To disable statistics collection, set the [config option]
/// `datafusion.execution.collect_statistics` to `false`. See
/// [`ConfigOptions`] and [`ExecutionOptions::collect_statistics`] for more
/// details.
///
Expand Down Expand Up @@ -171,28 +170,28 @@ mod tests {

#[tokio::test]
async fn register_parquet_respects_collect_statistics_config() -> Result<()> {
// The default is false
// The default is true
let mut config = SessionConfig::new();
config.options_mut().explain.physical_plan_only = true;
config.options_mut().explain.show_statistics = true;
let content = explain_query_all_with_config(config).await?;
assert_contains!(content, "statistics=[Rows=Absent,");
assert_contains!(content, "statistics=[Rows=Exact(");

// Explicitly set to false
// Explicitly set to true
let mut config = SessionConfig::new();
config.options_mut().explain.physical_plan_only = true;
config.options_mut().explain.show_statistics = true;
config.options_mut().execution.collect_statistics = false;
config.options_mut().execution.collect_statistics = true;
let content = explain_query_all_with_config(config).await?;
assert_contains!(content, "statistics=[Rows=Absent,");
assert_contains!(content, "statistics=[Rows=Exact(");

// Explicitly set to true
// Explicitly set to false
let mut config = SessionConfig::new();
config.options_mut().explain.physical_plan_only = true;
config.options_mut().explain.show_statistics = true;
config.options_mut().execution.collect_statistics = true;
config.options_mut().execution.collect_statistics = false;
let content = explain_query_all_with_config(config).await?;
assert_contains!(content, "statistics=[Rows=Exact(10),");
assert_contains!(content, "statistics=[Rows=Absent,");

Ok(())
}
Expand Down
10 changes: 8 additions & 2 deletions datafusion/core/src/execution/session_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ use datafusion_physical_expr::create_physical_expr;
use datafusion_physical_expr_common::physical_expr::PhysicalExpr;
use datafusion_physical_optimizer::optimizer::PhysicalOptimizer;
use datafusion_physical_optimizer::PhysicalOptimizerRule;
use datafusion_physical_plan::node_id::{
annotate_node_id_for_execution_plan, NodeIdAnnotator,
};
use datafusion_physical_plan::ExecutionPlan;
use datafusion_session::Session;
use datafusion_sql::parser::{DFParserBuilder, Statement};
Expand Down Expand Up @@ -654,9 +657,12 @@ impl SessionState {
logical_plan: &LogicalPlan,
) -> datafusion_common::Result<Arc<dyn ExecutionPlan>> {
let logical_plan = self.optimize(logical_plan)?;
self.query_planner
let physical_plan = self
.query_planner
.create_physical_plan(&logical_plan, self)
.await
.await?;
let mut id_annotator = NodeIdAnnotator::new();
annotate_node_id_for_execution_plan(&physical_plan, &mut id_annotator)
}

/// Create a [`PhysicalExpr`] from an [`Expr`] after applying type
Expand Down
Loading