Skip to content

Commit 6356e71

Browse files
committed
refine
1 parent 291149d commit 6356e71

File tree

32 files changed

+115
-199
lines changed

32 files changed

+115
-199
lines changed

src/query/service/src/physical_plans/physical_hash_join.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,14 @@ impl IPhysicalPlan for HashJoin {
240240
probe_keys: self.probe_keys.clone(),
241241
is_null_equal: self.is_null_equal.clone(),
242242
non_equi_conditions: self.non_equi_conditions.clone(),
243-
join_type: self.join_type.clone(),
243+
join_type: self.join_type,
244244
marker_index: self.marker_index,
245245
from_correlated_subquery: self.from_correlated_subquery,
246246
probe_to_build: self.probe_to_build.clone(),
247247
output_schema: self.output_schema.clone(),
248248
need_hold_hash_table: self.need_hold_hash_table,
249249
stat_info: self.stat_info.clone(),
250-
single_to_inner: self.single_to_inner.clone(),
250+
single_to_inner: self.single_to_inner,
251251
build_side_cache_info: self.build_side_cache_info.clone(),
252252
runtime_filter: self.runtime_filter.clone(),
253253
broadcast_id: self.broadcast_id,
@@ -445,7 +445,7 @@ impl HashJoin {
445445
build_input.clone(),
446446
probe_input.clone(),
447447
joined_output.clone(),
448-
factory.create_hash_join(self.join_type.clone(), 0)?,
448+
factory.create_hash_join(self.join_type, 0)?,
449449
stage_sync_barrier.clone(),
450450
self.projections.clone(),
451451
rf_desc.clone(),
@@ -1210,7 +1210,7 @@ impl PhysicalPlanBuilder {
12101210
probe_projections,
12111211
build: build_side,
12121212
probe: probe_side,
1213-
join_type: join.join_type.clone(),
1213+
join_type: join.join_type,
12141214
build_keys: right_join_conditions,
12151215
probe_keys: left_join_conditions,
12161216
is_null_equal,
@@ -1222,7 +1222,7 @@ impl PhysicalPlanBuilder {
12221222
output_schema,
12231223
need_hold_hash_table: join.need_hold_hash_table,
12241224
stat_info: Some(stat_info),
1225-
single_to_inner: join.single_to_inner.clone(),
1225+
single_to_inner: join.single_to_inner,
12261226
build_side_cache_info,
12271227
runtime_filter,
12281228
broadcast_id,

src/query/service/src/physical_plans/physical_range_join.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl IPhysicalPlan for RangeJoin {
133133
right: right_child,
134134
conditions: self.conditions.clone(),
135135
other_conditions: self.other_conditions.clone(),
136-
join_type: self.join_type.clone(),
136+
join_type: self.join_type,
137137
range_join_type: self.range_join_type.clone(),
138138
output_schema: self.output_schema.clone(),
139139
stat_info: self.stat_info.clone(),
@@ -264,7 +264,7 @@ impl PhysicalPlanBuilder {
264264
.iter()
265265
.map(|scalar| resolve_scalar(scalar, &merged_schema))
266266
.collect::<Result<_>>()?,
267-
join_type: join_type.clone(),
267+
join_type,
268268
range_join_type,
269269
output_schema: Arc::new(DataSchema::new(output_schema)),
270270
stat_info: Some(self.build_plan_stat_info(s_expr)?),

src/query/service/src/pipelines/processors/transforms/hash_join/desc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl HashJoinDesc {
118118
.collect();
119119

120120
Ok(HashJoinDesc {
121-
join_type: join.join_type.clone(),
121+
join_type: join.join_type,
122122
build_keys,
123123
probe_keys,
124124
is_null_equal: join.is_null_equal.clone(),
@@ -128,7 +128,7 @@ impl HashJoinDesc {
128128
// marker_index: join.marker_index,
129129
},
130130
from_correlated_subquery: join.from_correlated_subquery,
131-
single_to_inner: join.single_to_inner.clone(),
131+
single_to_inner: join.single_to_inner,
132132
runtime_filter: (&join.runtime_filter).into(),
133133
probe_to_build: join.probe_to_build.clone(),
134134
build_projection: join.build_projections.clone(),

src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_build_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ impl HashJoinBuildState {
870870
}
871871

872872
pub(crate) fn join_type(&self) -> JoinType {
873-
self.hash_join_state.hash_join_desc.join_type.clone()
873+
self.hash_join_state.hash_join_desc.join_type
874874
}
875875

876876
pub fn runtime_filter_desc(&self) -> &[RuntimeFilterDesc] {

src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_probe_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,6 @@ impl HashJoinProbeState {
784784
}
785785

786786
pub(crate) fn join_type(&self) -> JoinType {
787-
self.hash_join_state.hash_join_desc.join_type.clone()
787+
self.hash_join_state.hash_join_desc.join_type
788788
}
789789
}

src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_spiller.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl HashJoinSpiller {
123123
}
124124

125125
for data_block in data_blocks {
126-
let mut hashes = self.get_hashes(&data_block, &self.join_type)?;
126+
let mut hashes = self.get_hashes(&data_block, self.join_type)?;
127127

128128
for hash in hashes.iter_mut() {
129129
*hash = Self::get_partition_id(*hash, self.spill_partition_bits as u64);
@@ -143,10 +143,10 @@ impl HashJoinSpiller {
143143
return Ok(());
144144
}
145145

146-
let join_type = self.join_type.clone();
146+
let join_type = self.join_type;
147147
let data_block = DataBlock::concat(&data_blocks)?;
148148
let partition_data_blocks =
149-
self.partition_data_block(&data_block, &join_type, self.spill_partition_bits)?;
149+
self.partition_data_block(&data_block, join_type, self.spill_partition_bits)?;
150150
for (partition_id, data_block) in partition_data_blocks.into_iter().enumerate() {
151151
if !data_block.is_empty() {
152152
self.partition_buffer
@@ -184,7 +184,7 @@ impl HashJoinSpiller {
184184
let mut partitions_writer = HashMap::<usize, BlocksWriter>::new();
185185

186186
for data_block in data_blocks {
187-
let mut hashes = self.get_hashes(&data_block, &self.join_type)?;
187+
let mut hashes = self.get_hashes(&data_block, self.join_type)?;
188188

189189
for hash in hashes.iter_mut() {
190190
*hash = Self::get_partition_id(*hash, self.spill_partition_bits as u64);
@@ -249,14 +249,14 @@ impl HashJoinSpiller {
249249
data_blocks: &[DataBlock],
250250
partition_need_to_spill: Option<&HashSet<usize>>,
251251
) -> Result<Vec<DataBlock>> {
252-
let join_type = self.join_type.clone();
252+
let join_type = self.join_type;
253253
let mut unspilled_data_blocks = vec![];
254254

255255
let data_block = DataBlock::concat(data_blocks)?;
256256
let fetch_option =
257257
PartitionBufferFetchOption::PickPartitionWithThreshold(self.partition_threshold);
258258
for (partition_id, data_block) in self
259-
.partition_data_block(&data_block, &join_type, self.spill_partition_bits)?
259+
.partition_data_block(&data_block, join_type, self.spill_partition_bits)?
260260
.into_iter()
261261
.enumerate()
262262
{
@@ -343,10 +343,10 @@ impl HashJoinSpiller {
343343
fn partition_data_block(
344344
&mut self,
345345
data_block: &DataBlock,
346-
join_type: &JoinType,
346+
join_type: JoinType,
347347
partition_bits: usize,
348348
) -> Result<Vec<DataBlock>> {
349-
if join_type == &JoinType::Cross {
349+
if join_type == JoinType::Cross {
350350
Ok(vec![data_block.clone()])
351351
} else {
352352
let mut hashes = self.get_hashes(data_block, join_type)?;
@@ -364,7 +364,7 @@ impl HashJoinSpiller {
364364
}
365365

366366
// Get all hashes for build input data.
367-
fn get_hashes(&self, data_block: &DataBlock, join_type: &JoinType) -> Result<Vec<u64>> {
367+
fn get_hashes(&self, data_block: &DataBlock, join_type: JoinType) -> Result<Vec<u64>> {
368368
let mut hashes = Vec::with_capacity(data_block.num_rows());
369369
get_hashes(
370370
&self.func_ctx,

src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ impl HashJoinState {
236236
}
237237

238238
pub fn join_type(&self) -> JoinType {
239-
self.hash_join_desc.join_type.clone()
239+
self.hash_join_desc.join_type
240240
}
241241

242242
pub fn need_outer_scan(&self) -> bool {

src/query/service/src/pipelines/processors/transforms/hash_join/spill_common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn get_hashes(
3232
block: &DataBlock,
3333
keys: &[Expr],
3434
method: &HashMethodKind,
35-
join_type: &JoinType,
35+
join_type: JoinType,
3636
from_build: bool,
3737
is_null_equal: &[bool],
3838
hashes: &mut Vec<u64>,

src/query/service/src/pipelines/processors/transforms/new_hash_join/grace/grace_join.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ impl<T: GraceMemoryJoin> GraceHashJoin<T> {
277277
&data,
278278
&self.desc.build_keys,
279279
&self.hash_method_kind,
280-
&self.desc.join_type,
280+
self.desc.join_type,
281281
true,
282282
&self.desc.is_null_equal,
283283
&mut hashes,
@@ -298,7 +298,7 @@ impl<T: GraceMemoryJoin> GraceHashJoin<T> {
298298
&data,
299299
&self.desc.probe_keys,
300300
&self.hash_method_kind,
301-
&self.desc.join_type,
301+
self.desc.join_type,
302302
false,
303303
&self.desc.is_null_equal,
304304
&mut hashes,

src/query/service/src/pipelines/processors/transforms/range_join/range_join_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl RangeJoinState {
9999
finished_tasks: AtomicU64::new(0),
100100
completed_pair: AtomicU64::new(0),
101101
ie_join_state,
102-
join_type: range_join.join_type.clone(),
102+
join_type: range_join.join_type,
103103
left_match: RwLock::new(MutableBitmap::new()),
104104
right_match: RwLock::new(MutableBitmap::new()),
105105
partition_count: AtomicU64::new(0),

0 commit comments

Comments
 (0)