Skip to content

Commit 68ccdb4

Browse files
committed
Fix typo
1 parent b14651b commit 68ccdb4

File tree

4 files changed

+50
-50
lines changed

4 files changed

+50
-50
lines changed

src/distributed_ext.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::distributed_planner::{
66
set_distributed_network_coalesce_tasks, set_distributed_network_shuffle_tasks,
77
};
88
use crate::protobuf::{set_distributed_user_codec, set_distributed_user_codec_arc};
9-
use crate::{ChannelResolver, IntoPlanDependantUsize};
9+
use crate::{ChannelResolver, IntoPlanDependentUsize};
1010
use datafusion::common::DataFusionError;
1111
use datafusion::config::ConfigExtension;
1212
use datafusion::execution::{SessionState, SessionStateBuilder};
@@ -233,10 +233,10 @@ pub trait DistributedExt: Sized {
233233
/// ( task 1 ) ( task 2 ) ( task 3 ) N tasks
234234
/// ```
235235
/// This parameter defines N
236-
fn with_distributed_network_coalesce_tasks<T: IntoPlanDependantUsize>(self, tasks: T) -> Self;
236+
fn with_distributed_network_coalesce_tasks<T: IntoPlanDependentUsize>(self, tasks: T) -> Self;
237237

238238
/// Same as [DistributedExt::with_distributed_network_coalesce_tasks] but with an in-place mutation.
239-
fn set_distributed_network_coalesce_tasks<T: IntoPlanDependantUsize>(&mut self, tasks: T);
239+
fn set_distributed_network_coalesce_tasks<T: IntoPlanDependentUsize>(&mut self, tasks: T);
240240

241241
/// Upon shuffling data, this defines how many tasks are employed into performing the shuffling.
242242
/// ```text
@@ -246,10 +246,10 @@ pub trait DistributedExt: Sized {
246246
/// ( task 1 ) ( task 2 ) N tasks
247247
/// ```
248248
/// This parameter defines N
249-
fn with_distributed_network_shuffle_tasks<T: IntoPlanDependantUsize>(self, tasks: T) -> Self;
249+
fn with_distributed_network_shuffle_tasks<T: IntoPlanDependentUsize>(self, tasks: T) -> Self;
250250

251251
/// Same as [DistributedExt::with_distributed_network_shuffle_tasks] but with an in-place mutation.
252-
fn set_distributed_network_shuffle_tasks<T: IntoPlanDependantUsize>(&mut self, tasks: T);
252+
fn set_distributed_network_shuffle_tasks<T: IntoPlanDependentUsize>(&mut self, tasks: T);
253253
}
254254

255255
impl DistributedExt for SessionConfig {
@@ -282,11 +282,11 @@ impl DistributedExt for SessionConfig {
282282
set_distributed_channel_resolver(self, resolver)
283283
}
284284

285-
fn set_distributed_network_coalesce_tasks<T: IntoPlanDependantUsize>(&mut self, tasks: T) {
285+
fn set_distributed_network_coalesce_tasks<T: IntoPlanDependentUsize>(&mut self, tasks: T) {
286286
set_distributed_network_coalesce_tasks(self, tasks)
287287
}
288288

289-
fn set_distributed_network_shuffle_tasks<T: IntoPlanDependantUsize>(&mut self, tasks: T) {
289+
fn set_distributed_network_shuffle_tasks<T: IntoPlanDependentUsize>(&mut self, tasks: T) {
290290
set_distributed_network_shuffle_tasks(self, tasks)
291291
}
292292

@@ -314,11 +314,11 @@ impl DistributedExt for SessionConfig {
314314

315315
#[call(set_distributed_network_coalesce_tasks)]
316316
#[expr($;self)]
317-
fn with_distributed_network_coalesce_tasks<T: IntoPlanDependantUsize>(mut self, tasks: T) -> Self;
317+
fn with_distributed_network_coalesce_tasks<T: IntoPlanDependentUsize>(mut self, tasks: T) -> Self;
318318

319319
#[call(set_distributed_network_shuffle_tasks)]
320320
#[expr($;self)]
321-
fn with_distributed_network_shuffle_tasks<T: IntoPlanDependantUsize>(mut self, tasks: T) -> Self;
321+
fn with_distributed_network_shuffle_tasks<T: IntoPlanDependentUsize>(mut self, tasks: T) -> Self;
322322
}
323323
}
324324
}
@@ -351,15 +351,15 @@ impl DistributedExt for SessionStateBuilder {
351351
#[expr($;self)]
352352
fn with_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(mut self, resolver: T) -> Self;
353353

354-
fn set_distributed_network_coalesce_tasks<T: IntoPlanDependantUsize>(&mut self, tasks: T);
354+
fn set_distributed_network_coalesce_tasks<T: IntoPlanDependentUsize>(&mut self, tasks: T);
355355
#[call(set_distributed_network_coalesce_tasks)]
356356
#[expr($;self)]
357-
fn with_distributed_network_coalesce_tasks<T: IntoPlanDependantUsize>(mut self, tasks: T) -> Self;
357+
fn with_distributed_network_coalesce_tasks<T: IntoPlanDependentUsize>(mut self, tasks: T) -> Self;
358358

359-
fn set_distributed_network_shuffle_tasks<T: IntoPlanDependantUsize>(&mut self, tasks: T);
359+
fn set_distributed_network_shuffle_tasks<T: IntoPlanDependentUsize>(&mut self, tasks: T);
360360
#[call(set_distributed_network_shuffle_tasks)]
361361
#[expr($;self)]
362-
fn with_distributed_network_shuffle_tasks<T: IntoPlanDependantUsize>(mut self, tasks: T) -> Self;
362+
fn with_distributed_network_shuffle_tasks<T: IntoPlanDependentUsize>(mut self, tasks: T) -> Self;
363363
}
364364
}
365365
}
@@ -392,15 +392,15 @@ impl DistributedExt for SessionState {
392392
#[expr($;self)]
393393
fn with_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(mut self, resolver: T) -> Self;
394394

395-
fn set_distributed_network_coalesce_tasks<T: IntoPlanDependantUsize>(&mut self, tasks: T);
395+
fn set_distributed_network_coalesce_tasks<T: IntoPlanDependentUsize>(&mut self, tasks: T);
396396
#[call(set_distributed_network_coalesce_tasks)]
397397
#[expr($;self)]
398-
fn with_distributed_network_coalesce_tasks<T: IntoPlanDependantUsize>(mut self, tasks: T) -> Self;
398+
fn with_distributed_network_coalesce_tasks<T: IntoPlanDependentUsize>(mut self, tasks: T) -> Self;
399399

400-
fn set_distributed_network_shuffle_tasks<T: IntoPlanDependantUsize>(&mut self, tasks: T);
400+
fn set_distributed_network_shuffle_tasks<T: IntoPlanDependentUsize>(&mut self, tasks: T);
401401
#[call(set_distributed_network_shuffle_tasks)]
402402
#[expr($;self)]
403-
fn with_distributed_network_shuffle_tasks<T: IntoPlanDependantUsize>(mut self, tasks: T) -> Self;
403+
fn with_distributed_network_shuffle_tasks<T: IntoPlanDependentUsize>(mut self, tasks: T) -> Self;
404404
}
405405
}
406406
}
@@ -433,15 +433,15 @@ impl DistributedExt for SessionContext {
433433
#[expr($;self)]
434434
fn with_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(self, resolver: T) -> Self;
435435

436-
fn set_distributed_network_coalesce_tasks<T: IntoPlanDependantUsize>(&mut self, tasks: T);
436+
fn set_distributed_network_coalesce_tasks<T: IntoPlanDependentUsize>(&mut self, tasks: T);
437437
#[call(set_distributed_network_coalesce_tasks)]
438438
#[expr($;self)]
439-
fn with_distributed_network_coalesce_tasks<T: IntoPlanDependantUsize>(self, tasks: T) -> Self;
439+
fn with_distributed_network_coalesce_tasks<T: IntoPlanDependentUsize>(self, tasks: T) -> Self;
440440

441-
fn set_distributed_network_shuffle_tasks<T: IntoPlanDependantUsize>(&mut self, tasks: T);
441+
fn set_distributed_network_shuffle_tasks<T: IntoPlanDependentUsize>(&mut self, tasks: T);
442442
#[call(set_distributed_network_shuffle_tasks)]
443443
#[expr($;self)]
444-
fn with_distributed_network_shuffle_tasks<T: IntoPlanDependantUsize>(self, tasks: T) -> Self;
444+
fn with_distributed_network_shuffle_tasks<T: IntoPlanDependentUsize>(self, tasks: T) -> Self;
445445
}
446446
}
447447
}

src/distributed_planner/distributed_config.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,57 @@ use std::sync::Arc;
77

88
#[derive(Clone)]
99
#[allow(clippy::type_complexity)]
10-
pub struct PlanDependantUsize(
10+
pub struct PlanDependentUsize(
1111
pub(crate) Arc<dyn Fn(&Arc<dyn ExecutionPlan>) -> usize + Send + Sync>,
1212
);
1313

14-
impl PlanDependantUsize {
14+
impl PlanDependentUsize {
1515
pub fn call(&self, plan: &Arc<dyn ExecutionPlan>) -> usize {
1616
self.0(plan)
1717
}
1818
}
1919

20-
pub trait IntoPlanDependantUsize {
21-
fn into_plan_dependant_usize(self) -> PlanDependantUsize;
20+
pub trait IntoPlanDependentUsize {
21+
fn into_plan_dependent_usize(self) -> PlanDependentUsize;
2222
}
2323

24-
impl IntoPlanDependantUsize for usize {
25-
fn into_plan_dependant_usize(self) -> PlanDependantUsize {
26-
PlanDependantUsize(Arc::new(move |_| self))
24+
impl IntoPlanDependentUsize for usize {
25+
fn into_plan_dependent_usize(self) -> PlanDependentUsize {
26+
PlanDependentUsize(Arc::new(move |_| self))
2727
}
2828
}
2929

30-
impl<T: Fn(&Arc<dyn ExecutionPlan>) -> usize + Send + Sync + 'static> IntoPlanDependantUsize for T {
31-
fn into_plan_dependant_usize(self) -> PlanDependantUsize {
32-
PlanDependantUsize(Arc::new(self))
30+
impl<T: Fn(&Arc<dyn ExecutionPlan>) -> usize + Send + Sync + 'static> IntoPlanDependentUsize for T {
31+
fn into_plan_dependent_usize(self) -> PlanDependentUsize {
32+
PlanDependentUsize(Arc::new(self))
3333
}
3434
}
3535

36-
impl Default for PlanDependantUsize {
36+
impl Default for PlanDependentUsize {
3737
fn default() -> Self {
38-
PlanDependantUsize(Arc::new(|_| 0))
38+
PlanDependentUsize(Arc::new(|_| 0))
3939
}
4040
}
4141

42-
impl Debug for PlanDependantUsize {
42+
impl Debug for PlanDependentUsize {
4343
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
4444
write!(f, "PlanDependantUsize")
4545
}
4646
}
4747

48-
impl Display for PlanDependantUsize {
48+
impl Display for PlanDependentUsize {
4949
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
5050
write!(f, "PlanDependantUsize")
5151
}
5252
}
5353

54-
impl ConfigField for PlanDependantUsize {
54+
impl ConfigField for PlanDependentUsize {
5555
fn visit<V: Visit>(&self, v: &mut V, key: &str, description: &'static str) {
5656
v.some(key, self, description);
5757
}
5858

5959
fn set(&mut self, _: &str, value: &str) -> datafusion::common::Result<()> {
60-
*self = default_config_transform::<usize>(value)?.into_plan_dependant_usize();
60+
*self = default_config_transform::<usize>(value)?.into_plan_dependent_usize();
6161
Ok(())
6262
}
6363
}
@@ -72,7 +72,7 @@ extensions_options! {
7272
/// ( task 1 ) ( task 2 ) N tasks
7373
/// ```
7474
/// This parameter defines N
75-
pub network_shuffle_tasks: Option<PlanDependantUsize>, default = None
75+
pub network_shuffle_tasks: Option<PlanDependentUsize>, default = None
7676
/// Upon merging multiple tasks into one, this defines how many tasks are merged.
7777
/// ```text
7878
/// ( task 1 )
@@ -81,7 +81,7 @@ extensions_options! {
8181
/// ( task 1 ) ( task 2 ) ( task 3 ) N tasks
8282
/// ```
8383
/// This parameter defines N
84-
pub network_coalesce_tasks: Option<PlanDependantUsize>, default = None
84+
pub network_coalesce_tasks: Option<PlanDependentUsize>, default = None
8585
}
8686
}
8787

@@ -91,36 +91,36 @@ impl ConfigExtension for DistributedConfig {
9191

9292
impl DistributedConfig {
9393
/// Sets the amount of tasks used in a network shuffle operation.
94-
pub fn with_network_shuffle_tasks(mut self, tasks: impl IntoPlanDependantUsize) -> Self {
95-
self.network_shuffle_tasks = Some(tasks.into_plan_dependant_usize());
94+
pub fn with_network_shuffle_tasks(mut self, tasks: impl IntoPlanDependentUsize) -> Self {
95+
self.network_shuffle_tasks = Some(tasks.into_plan_dependent_usize());
9696
self
9797
}
9898

9999
/// Sets the amount of tasks used in a network coalesce operation.
100-
pub fn with_network_coalesce_tasks(mut self, tasks: impl IntoPlanDependantUsize) -> Self {
101-
self.network_coalesce_tasks = Some(tasks.into_plan_dependant_usize());
100+
pub fn with_network_coalesce_tasks(mut self, tasks: impl IntoPlanDependentUsize) -> Self {
101+
self.network_coalesce_tasks = Some(tasks.into_plan_dependent_usize());
102102
self
103103
}
104104
}
105105

106106
pub(crate) fn set_distributed_network_coalesce_tasks(
107107
cfg: &mut SessionConfig,
108-
tasks: impl IntoPlanDependantUsize,
108+
tasks: impl IntoPlanDependentUsize,
109109
) {
110110
let ext = &mut cfg.options_mut().extensions;
111111
let Some(prev) = ext.get_mut::<DistributedConfig>() else {
112112
return ext.insert(DistributedConfig::default().with_network_coalesce_tasks(tasks));
113113
};
114-
prev.network_coalesce_tasks = Some(tasks.into_plan_dependant_usize());
114+
prev.network_coalesce_tasks = Some(tasks.into_plan_dependent_usize());
115115
}
116116

117117
pub(crate) fn set_distributed_network_shuffle_tasks(
118118
cfg: &mut SessionConfig,
119-
tasks: impl IntoPlanDependantUsize,
119+
tasks: impl IntoPlanDependentUsize,
120120
) {
121121
let ext = &mut cfg.options_mut().extensions;
122122
let Some(prev) = ext.get_mut::<DistributedConfig>() else {
123123
return ext.insert(DistributedConfig::default().with_network_shuffle_tasks(tasks));
124124
};
125-
prev.network_shuffle_tasks = Some(tasks.into_plan_dependant_usize());
125+
prev.network_shuffle_tasks = Some(tasks.into_plan_dependent_usize());
126126
}

src/distributed_planner/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub(crate) use distributed_config::{
77
set_distributed_network_coalesce_tasks, set_distributed_network_shuffle_tasks,
88
};
99

10-
pub use distributed_config::{DistributedConfig, IntoPlanDependantUsize, PlanDependantUsize};
10+
pub use distributed_config::{DistributedConfig, IntoPlanDependentUsize, PlanDependentUsize};
1111
pub use distributed_physical_optimizer_rule::{
1212
DistributedPhysicalOptimizerRule, apply_network_boundaries, distribute_plan,
1313
};

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub mod test_utils;
1717
pub use channel_resolver_ext::{BoxCloneSyncChannel, ChannelResolver};
1818
pub use distributed_ext::DistributedExt;
1919
pub use distributed_planner::{
20-
DistributedConfig, DistributedPhysicalOptimizerRule, InputStageInfo, IntoPlanDependantUsize,
21-
NetworkBoundary, NetworkBoundaryExt, PlanDependantUsize, apply_network_boundaries,
20+
DistributedConfig, DistributedPhysicalOptimizerRule, InputStageInfo, IntoPlanDependentUsize,
21+
NetworkBoundary, NetworkBoundaryExt, PlanDependentUsize, apply_network_boundaries,
2222
distribute_plan,
2323
};
2424
pub use execution_plans::{

0 commit comments

Comments
 (0)