Skip to content

Commit 5a99099

Browse files
committed
Merge remote-tracking branch 'origin/branch-48-stream' into branch_49_fix
2 parents c6b8211 + 6e71350 commit 5a99099

50 files changed

Lines changed: 163 additions & 197 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ jobs:
4444
- name: Run audit check
4545
# Ignored until https://github.com/apache/datafusion/issues/15571
4646
# ignored py03 warning until arrow 55 upgrade
47-
run: cargo audit --ignore RUSTSEC-2024-0370 --ignore RUSTSEC-2025-0020
47+
run: cargo audit --ignore RUSTSEC-2024-0370 --ignore RUSTSEC-2025-0020 --ignore RUSTSEC-2025-0047

Cargo.lock

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

datafusion-examples/examples/planner_api.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -80,35 +80,9 @@ async fn to_physical_plan_in_one_api_demo(
8080
displayable(physical_plan.as_ref()).indent(false)
8181
);
8282

83-
let traversal = extract_node_ids_from_execution_plan_tree(physical_plan.as_ref());
84-
let expected_traversal = vec![
85-
Some(0),
86-
Some(1),
87-
Some(2),
88-
Some(3),
89-
Some(4),
90-
Some(5),
91-
Some(6),
92-
Some(7),
93-
Some(8),
94-
Some(9),
95-
];
96-
assert_eq!(expected_traversal, traversal);
9783
Ok(())
9884
}
9985

100-
fn extract_node_ids_from_execution_plan_tree(
101-
physical_plan: &dyn ExecutionPlan,
102-
) -> Vec<Option<usize>> {
103-
let mut traversed_nodes: Vec<Option<usize>> = vec![];
104-
for child in physical_plan.children() {
105-
let node_ids = extract_node_ids_from_execution_plan_tree(child.as_ref());
106-
traversed_nodes.extend(node_ids);
107-
}
108-
traversed_nodes.push(physical_plan.properties().node_id());
109-
traversed_nodes
110-
}
111-
11286
/// Converts a logical plan into a physical plan by utilizing the analyzer,
11387
/// optimizer, and query planner APIs separately. This flavor gives more
11488
/// control over the planning process.

datafusion/core/tests/fuzz_cases/sort_fuzz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ impl SortTest {
224224
/// Sort the input using SortExec and ensure the results are
225225
/// correct according to `Vec::sort` both with and without spilling
226226
async fn run(&self) -> (Vec<Vec<RecordBatch>>, Vec<RecordBatch>) {
227-
let input = Arc::clone(self.input());
227+
let input = self.input.clone();
228228
let first_batch = input
229229
.iter()
230230
.flat_map(|p| p.iter())

datafusion/core/tests/parquet/page_pruning.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ async fn page_index_filter_one_col() {
165165

166166
// 5.create filter date_string_col == "01/01/09"`;
167167
// Note this test doesn't apply type coercion so the literal must match the actual view type
168-
let filter = col("date_string_col").eq(lit(ScalarValue::new_utf8view("01/01/09")));
168+
// xudong: use new_utf8, because schema_force_view_types was changed to false now.
169+
// qi: when schema_force_view_types setting to true, we should change back to utf8view
170+
let filter = col("date_string_col").eq(lit(ScalarValue::new_utf8("01/01/09")));
169171
let batches = get_filter_results(&state, filter.clone(), false).await;
170172
assert_eq!(batches[0].num_rows(), 14);
171173

datafusion/core/tests/physical_optimizer/enforce_distribution.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3612,18 +3612,19 @@ fn test_replace_order_preserving_variants_with_fetch() -> Result<()> {
36123612
);
36133613

36143614
// Apply the function
3615-
let result = replace_order_preserving_variants(dist_context)?;
3615+
let result = replace_order_preserving_variants(dist_context, false)?;
36163616

36173617
// Verify the plan was transformed to CoalescePartitionsExec
36183618
result
3619+
.0
36193620
.plan
36203621
.as_any()
36213622
.downcast_ref::<CoalescePartitionsExec>()
36223623
.expect("Expected CoalescePartitionsExec");
36233624

36243625
// Verify fetch was preserved
36253626
assert_eq!(
3626-
result.plan.fetch(),
3627+
result.0.plan.fetch(),
36273628
Some(5),
36283629
"Fetch value was not preserved after transformation"
36293630
);

datafusion/datasource/src/sink.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,14 @@ impl ExecutionPlan for DataSinkExec {
252252

253253
fn with_node_id(
254254
self: Arc<Self>,
255-
_node_id: usize,
255+
node_id: usize,
256256
) -> Result<Option<Arc<dyn ExecutionPlan>>> {
257257
let mut new_plan = DataSinkExec::new(
258258
Arc::clone(self.input()),
259259
Arc::clone(&self.sink),
260260
self.sort_order.clone(),
261261
);
262-
let new_props = new_plan.cache.clone().with_node_id(_node_id);
262+
let new_props = new_plan.cache.clone().with_node_id(node_id);
263263
new_plan.cache = new_props;
264264
Ok(Some(Arc::new(new_plan)))
265265
}

datafusion/datasource/src/source.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,10 @@ impl ExecutionPlan for DataSourceExec {
362362

363363
fn with_node_id(
364364
self: Arc<Self>,
365-
_node_id: usize,
365+
node_id: usize,
366366
) -> Result<Option<Arc<dyn ExecutionPlan>>> {
367-
let mut new_plan = DataSourceExec::new(self.data_source.clone());
368-
let new_props = new_plan.cache.clone().with_node_id(_node_id);
367+
let mut new_plan = DataSourceExec::new(Arc::clone(&self.data_source));
368+
let new_props = new_plan.cache.clone().with_node_id(node_id);
369369
new_plan.cache = new_props;
370370
Ok(Some(Arc::new(new_plan)))
371371
}

datafusion/optimizer/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ pub mod push_down_limit;
6161
pub mod replace_distinct_aggregate;
6262
pub mod scalar_subquery_to_join;
6363
pub mod simplify_expressions;
64-
mod simplify_predicates;
6564
pub mod single_distinct_to_groupby;
6665
pub mod utils;
6766

datafusion/optimizer/src/push_down_filter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use datafusion_expr::{
4141

4242
use crate::optimizer::ApplyOrder;
4343
use crate::utils::{has_all_column_refs, is_restrict_null_predicate};
44-
use crate::{simplify_predicates::simplify_predicates, OptimizerConfig, OptimizerRule};
44+
use crate::{simplify_expressions::simplify_predicates, OptimizerConfig, OptimizerRule};
4545

4646
/// Optimizer rule for pushing (moving) filter expressions down in a plan so
4747
/// they are applied as early as possible.
@@ -2311,7 +2311,7 @@ mod tests {
23112311
plan,
23122312
@r"
23132313
Projection: test.a, test1.d
2314-
Cross Join:
2314+
Cross Join:
23152315
Projection: test.a, test.b, test.c
23162316
TableScan: test, full_filters=[test.a = Int32(1)]
23172317
Projection: test1.d, test1.e, test1.f
@@ -2341,7 +2341,7 @@ mod tests {
23412341
plan,
23422342
@r"
23432343
Projection: test.a, test1.a
2344-
Cross Join:
2344+
Cross Join:
23452345
Projection: test.a, test.b, test.c
23462346
TableScan: test, full_filters=[test.a = Int32(1)]
23472347
Projection: test1.a, test1.b, test1.c

0 commit comments

Comments
 (0)