Skip to content

Commit d51385d

Browse files
committed
format
1 parent 059a4d6 commit d51385d

File tree

2 files changed

+51
-9
lines changed

2 files changed

+51
-9
lines changed

native-engine/datafusion-ext-plans/src/joins/smj/full_join.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ impl<const L_OUTER: bool, const R_OUTER: bool> Joiner for FullJoiner<L_OUTER, R_
167167
let new_size = equal_lindices.len() * equal_rindices.len();
168168
if self.has_enough_room(new_size) {
169169
// old cartesian_product way
170-
for (&lidx, &ridx) in equal_lindices.iter().cartesian_product(&equal_rindices) {
170+
for (&lidx, &ridx) in
171+
equal_lindices.iter().cartesian_product(&equal_rindices)
172+
{
171173
self.lindices.push(lidx);
172174
self.rindices.push(ridx);
173175
}

native-engine/datafusion-ext-plans/src/joins/test.rs

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ mod tests {
3232
error::Result,
3333
physical_expr::expressions::Column,
3434
physical_plan::{ExecutionPlan, common, joins::utils::*, test::TestMemoryExec},
35-
prelude::SessionContext,
35+
prelude::{SessionConfig, SessionContext},
3636
};
37-
use datafusion::prelude::SessionConfig;
37+
3838
use crate::{
3939
broadcast_join_build_hash_map_exec::BroadcastJoinBuildHashMapExec,
4040
broadcast_join_exec::BroadcastJoinExec,
@@ -270,7 +270,7 @@ mod tests {
270270
right: Arc<dyn ExecutionPlan>,
271271
on: JoinOn,
272272
join_type: JoinType,
273-
batch_size: usize
273+
batch_size: usize,
274274
) -> Result<(Vec<String>, Vec<RecordBatch>)> {
275275
MemManager::init(1000000);
276276
let session_config = SessionConfig::new().with_batch_size(batch_size);
@@ -572,15 +572,55 @@ mod tests {
572572
"| 1 | 5 | 5 | 1 | 7 | 7 |",
573573
"+----+----+----+----+----+----+",
574574
];
575-
let (_, batches) = join_collect_with_batch_size(test_type, left.clone(), right.clone(), on.clone(), Inner, 2).await?;
575+
let (_, batches) = join_collect_with_batch_size(
576+
test_type,
577+
left.clone(),
578+
right.clone(),
579+
on.clone(),
580+
Inner,
581+
2,
582+
)
583+
.await?;
576584
assert_batches_sorted_eq!(expected, &batches);
577-
let (_, batches) = join_collect_with_batch_size(test_type, left.clone(), right.clone(), on.clone(), Inner, 3).await?;
585+
let (_, batches) = join_collect_with_batch_size(
586+
test_type,
587+
left.clone(),
588+
right.clone(),
589+
on.clone(),
590+
Inner,
591+
3,
592+
)
593+
.await?;
578594
assert_batches_sorted_eq!(expected, &batches);
579-
let (_, batches) = join_collect_with_batch_size(test_type, left.clone(), right.clone(), on.clone(), Inner, 4).await?;
595+
let (_, batches) = join_collect_with_batch_size(
596+
test_type,
597+
left.clone(),
598+
right.clone(),
599+
on.clone(),
600+
Inner,
601+
4,
602+
)
603+
.await?;
580604
assert_batches_sorted_eq!(expected, &batches);
581-
let (_, batches) = join_collect_with_batch_size(test_type, left.clone(), right.clone(), on.clone(), Inner, 5).await?;
605+
let (_, batches) = join_collect_with_batch_size(
606+
test_type,
607+
left.clone(),
608+
right.clone(),
609+
on.clone(),
610+
Inner,
611+
5,
612+
)
613+
.await?;
582614
assert_batches_sorted_eq!(expected, &batches);
583-
let (_, batches) = join_collect_with_batch_size(test_type, left.clone(), right.clone(), on.clone(), Inner, 7).await?;
615+
let (_, batches) = join_collect_with_batch_size(
616+
test_type,
617+
left.clone(),
618+
right.clone(),
619+
on.clone(),
620+
Inner,
621+
7,
622+
)
623+
.await?;
584624
assert_batches_sorted_eq!(expected, &batches);
585625
}
586626
Ok(())

0 commit comments

Comments
 (0)