Skip to content

Commit ea9b0b5

Browse files
committed
[AURON #2001] Upgrade Rust nightly toolchain to 2025-06-23.
Signed-off-by: slfan1989 <slfan1989@apache.org>
1 parent e452ed5 commit ea9b0b5

7 files changed

Lines changed: 68 additions & 68 deletions

File tree

native-engine/datafusion-ext-plans/src/agg/acc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,10 @@ impl AccBytesColumn {
456456
fn refresh_heap_mem_used(&mut self) {
457457
self.heap_mem_used = 0;
458458
for item in &self.items {
459-
if let Some(v) = item {
460-
if v.spilled() {
461-
self.heap_mem_used += v.capacity();
462-
}
459+
if let Some(v) = item
460+
&& v.spilled()
461+
{
462+
self.heap_mem_used += v.capacity();
463463
}
464464
}
465465
}

native-engine/datafusion-ext-plans/src/agg/agg_table.rs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ impl AggTable {
126126
self.update_mem_used(mem_used).await?;
127127

128128
// update udaf memory tracker, spill if update failed
129-
if let Some(udaf_mem_tracker) = self.agg_ctx.get_udaf_mem_tracker() {
130-
if !udaf_mem_tracker.update_used()? {
131-
self.force_spill().await?;
132-
}
129+
if let Some(udaf_mem_tracker) = self.agg_ctx.get_udaf_mem_tracker()
130+
&& !udaf_mem_tracker.update_used()?
131+
{
132+
self.force_spill().await?;
133133
}
134134
Ok(())
135135
}
@@ -329,10 +329,10 @@ impl MemConsumer for AggTable {
329329

330330
// use pre-merging if cardinality is low
331331
let mut next_is_hashing = false;
332-
if let InMemData::Hashing(hashing_data) = &in_mem.data {
333-
if hashing_data.cardinality_ratio() < 0.5 {
334-
next_is_hashing = true;
335-
}
332+
if let InMemData::Hashing(hashing_data) = &in_mem.data
333+
&& hashing_data.cardinality_ratio() < 0.5
334+
{
335+
next_is_hashing = true;
336336
}
337337
let cur_in_mem = in_mem.renew(next_is_hashing)?;
338338

@@ -449,15 +449,14 @@ impl InMemTable {
449449
if self.id == 0 // only works on first table
450450
&& !self.agg_ctx.is_expand_agg
451451
&& self.agg_ctx.supports_partial_skipping
452+
&& let InMemData::Hashing(hashing_data) = &self.data
452453
{
453-
if let InMemData::Hashing(hashing_data) = &self.data {
454-
let cardinality_ratio = hashing_data.cardinality_ratio();
455-
if cardinality_ratio > self.agg_ctx.partial_skipping_ratio {
456-
log::warn!(
457-
"AggTable cardinality ratio = {cardinality_ratio}, will trigger partial skipping",
458-
);
459-
return true;
460-
}
454+
let cardinality_ratio = hashing_data.cardinality_ratio();
455+
if cardinality_ratio > self.agg_ctx.partial_skipping_ratio {
456+
log::warn!(
457+
"AggTable cardinality ratio = {cardinality_ratio}, will trigger partial skipping",
458+
);
459+
return true;
461460
}
462461
}
463462
false

native-engine/datafusion-ext-plans/src/common/cached_exprs_evaluator.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ fn transform_to_cached_exprs(exprs: &[PhysicalExprRef]) -> Result<(Vec<PhysicalE
211211
// short circuiting expression - only first child can be cached
212212
// first `when` expr can also be cached
213213
collect_dups(&expr.children()[0], current_count, expr_counts, dups);
214-
if let Ok(case_expr) = downcast_any!(expr, CaseExpr) {
215-
if case_expr.expr().is_some() {
216-
let children = case_expr.children();
217-
if children.len() >= 2 {
218-
// cache first `when` expr
219-
collect_dups(&expr.children()[1], current_count, expr_counts, dups);
220-
}
214+
if let Ok(case_expr) = downcast_any!(expr, CaseExpr)
215+
&& case_expr.expr().is_some()
216+
{
217+
let children = case_expr.children();
218+
if children.len() >= 2 {
219+
// cache first `when` expr
220+
collect_dups(&expr.children()[1], current_count, expr_counts, dups);
221221
}
222222
}
223223
} else {
@@ -272,11 +272,12 @@ fn transform_to_cached_exprs(exprs: &[PhysicalExprRef]) -> Result<(Vec<PhysicalE
272272
.collect::<Vec<_>>();
273273
children[0] = transform(children[0].clone(), cached_expr_ids, cache)?;
274274

275-
if let Some(case_expr) = expr.as_any().downcast_ref::<CaseExpr>() {
276-
if children.len() >= 2 && case_expr.expr().is_some() {
277-
// cache first `when` expr
278-
children[1] = transform(children[1].clone(), cached_expr_ids, cache)?;
279-
}
275+
if let Some(case_expr) = expr.as_any().downcast_ref::<CaseExpr>()
276+
&& children.len() >= 2
277+
&& case_expr.expr().is_some()
278+
{
279+
// cache first `when` expr
280+
children[1] = transform(children[1].clone(), cached_expr_ids, cache)?;
280281
}
281282
expr.clone().with_new_children(children)?
282283
} else {

native-engine/datafusion-ext-plans/src/common/execution_context.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,10 @@ impl ExecutionContext {
431431
match ready!(self.as_mut().input.poll_next_unpin(cx)) {
432432
Some(r) => Poll::Ready(Some(r)),
433433
None => {
434-
if let Some(on_completion) = self.as_mut().on_completion.take() {
435-
if let Err(e) = on_completion() {
436-
return Poll::Ready(Some(Err(e)));
437-
}
434+
if let Some(on_completion) = self.as_mut().on_completion.take()
435+
&& let Err(e) = on_completion()
436+
{
437+
return Poll::Ready(Some(Err(e)));
438438
}
439439
Poll::Ready(None)
440440
}

native-engine/datafusion-ext-plans/src/debug_exec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl ExecutionPlan for DebugExec {
109109
Ok(
110110
exec_ctx.output_with_sender("Debug", move |sender| async move {
111111
while let Some(batch) = input.next().await.transpose()? {
112-
let table_str = pretty_format_batches(&[batch.clone()])?
112+
let table_str = pretty_format_batches(std::slice::from_ref(&batch))?
113113
.to_string()
114114
.replace('\n', &format!("\n{debug_id} - "));
115115
log::info!("DebugExec(partition={partition}):\n{table_str}");

native-engine/datafusion-ext-plans/src/generate_exec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ mod test {
402402
"| | | {} |",
403403
"+---+-----------------+----------------+",
404404
];
405-
assert_batches_eq!(input, &[input_batch.clone()]);
405+
assert_batches_eq!(input, std::slice::from_ref(&input_batch));
406406

407407
let input = Arc::new(TestMemoryExec::try_new(
408408
&[vec![input_batch.clone()]],

native-engine/datafusion-ext-plans/src/orc_exec.rs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -455,13 +455,13 @@ fn collect_and_predicates(
455455
}
456456

457457
// Handle BinaryExpr with AND operator
458-
if let Some(binary) = expr.as_any().downcast_ref::<BinaryExpr>() {
459-
if matches!(binary.op(), Operator::And) {
460-
// Recursively collect AND sub-conditions from both sides
461-
collect_and_predicates(binary.left(), schema, predicates);
462-
collect_and_predicates(binary.right(), schema, predicates);
463-
return;
464-
}
458+
if let Some(binary) = expr.as_any().downcast_ref::<BinaryExpr>()
459+
&& matches!(binary.op(), Operator::And)
460+
{
461+
// Recursively collect AND sub-conditions from both sides
462+
collect_and_predicates(binary.left(), schema, predicates);
463+
collect_and_predicates(binary.right(), schema, predicates);
464+
return;
465465
}
466466

467467
// Not an AND expression, convert the whole expression
@@ -487,13 +487,13 @@ fn collect_or_predicates(
487487
}
488488

489489
// Handle BinaryExpr with OR operator
490-
if let Some(binary) = expr.as_any().downcast_ref::<BinaryExpr>() {
491-
if matches!(binary.op(), Operator::Or) {
492-
// Recursively collect OR sub-conditions from both sides
493-
collect_or_predicates(binary.left(), schema, predicates);
494-
collect_or_predicates(binary.right(), schema, predicates);
495-
return;
496-
}
490+
if let Some(binary) = expr.as_any().downcast_ref::<BinaryExpr>()
491+
&& matches!(binary.op(), Operator::Or)
492+
{
493+
// Recursively collect OR sub-conditions from both sides
494+
collect_or_predicates(binary.left(), schema, predicates);
495+
collect_or_predicates(binary.right(), schema, predicates);
496+
return;
497497
}
498498

499499
// Not an OR expression, convert the whole expression
@@ -667,10 +667,10 @@ fn convert_expr_to_orc_internal(
667667
// Convert IN to multiple OR conditions: col = val1 OR col = val2 OR ...
668668
let mut predicates = Vec::new();
669669
for list_expr in in_list.list() {
670-
if let Some(lit) = list_expr.as_any().downcast_ref::<Literal>() {
671-
if let Some(pred_value) = convert_scalar_value(lit.value()) {
672-
predicates.push(Predicate::eq(col_name, pred_value));
673-
}
670+
if let Some(lit) = list_expr.as_any().downcast_ref::<Literal>()
671+
&& let Some(pred_value) = convert_scalar_value(lit.value())
672+
{
673+
predicates.push(Predicate::eq(col_name, pred_value));
674674
}
675675
}
676676

@@ -699,20 +699,20 @@ fn convert_expr_to_orc_internal(
699699
return None;
700700
}
701701

702-
if let Some(col) = left.as_any().downcast_ref::<Column>() {
703-
if let Some(lit) = right.as_any().downcast_ref::<Literal>() {
704-
let col_name = col.name();
705-
let value = lit.value();
706-
return build_comparison_predicate(col_name, op, value);
707-
}
702+
if let Some(col) = left.as_any().downcast_ref::<Column>()
703+
&& let Some(lit) = right.as_any().downcast_ref::<Literal>()
704+
{
705+
let col_name = col.name();
706+
let value = lit.value();
707+
return build_comparison_predicate(col_name, op, value);
708708
}
709709

710-
if let Some(lit) = left.as_any().downcast_ref::<Literal>() {
711-
if let Some(col) = right.as_any().downcast_ref::<Column>() {
712-
let col_name = col.name();
713-
let value = lit.value();
714-
return build_comparison_predicate_reversed(col_name, op, value);
715-
}
710+
if let Some(lit) = left.as_any().downcast_ref::<Literal>()
711+
&& let Some(col) = right.as_any().downcast_ref::<Column>()
712+
{
713+
let col_name = col.name();
714+
let value = lit.value();
715+
return build_comparison_predicate_reversed(col_name, op, value);
716716
}
717717
}
718718

0 commit comments

Comments
 (0)