Skip to content

Commit 532f262

Browse files
committed
Apply cargo fmt
1 parent 64cbc36 commit 532f262

File tree

6 files changed

+28
-17
lines changed

6 files changed

+28
-17
lines changed

datafusion-examples/examples/advanced_udwf.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,10 @@ async fn main() -> Result<()> {
216216
df.show().await?;
217217

218218
// Now, run the function using the DataFrame API:
219-
let window_expr = smooth_it.call(vec![col("speed")]) // smooth_it(speed)
220-
.partition_by(vec![col("car")]) // PARTITION BY car
221-
.order_by(vec![col("time").sort(true, true)]) // ORDER BY time ASC
219+
let window_expr = smooth_it
220+
.call(vec![col("speed")]) // smooth_it(speed)
221+
.partition_by(vec![col("car")]) // PARTITION BY car
222+
.order_by(vec![col("time").sort(true, true)]) // ORDER BY time ASC
222223
.window_frame(WindowFrame::new(None))
223224
.build()?;
224225
let df = ctx.table("cars").await?.window(vec![window_expr])?;

datafusion-examples/examples/simple_udwf.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,10 @@ async fn main() -> Result<()> {
118118
df.show().await?;
119119

120120
// Now, run the function using the DataFrame API:
121-
let window_expr = smooth_it.call(vec![col("speed")]) // smooth_it(speed)
122-
.partition_by(vec![col("car")]) // PARTITION BY car
123-
.order_by(vec![col("time").sort(true, true)]) // ORDER BY time ASC
121+
let window_expr = smooth_it
122+
.call(vec![col("speed")]) // smooth_it(speed)
123+
.partition_by(vec![col("car")]) // PARTITION BY car
124+
.order_by(vec![col("time").sort(true, true)]) // ORDER BY time ASC
124125
.window_frame(WindowFrame::new(None))
125126
.build()?;
126127
let df = ctx.table("cars").await?.window(vec![window_expr])?;

datafusion/expr/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// under the License.
1717
// Make cheap clones clear: https://github.com/apache/datafusion/issues/11143
1818
#![deny(clippy::clone_on_ref_ptr)]
19-
2019
// TODO When the deprecated trait AggregateExt is removed, remove this unstable feature.
2120
#![feature(trait_alias)]
2221

@@ -90,9 +89,9 @@ pub use signature::{
9089
};
9190
pub use sqlparser;
9291
pub use table_source::{TableProviderFilterPushDown, TableSource, TableType};
93-
pub use udaf::{AggregateUDF, AggregateUDFImpl, ReversedUDAF};
9492
#[allow(deprecated)]
9593
pub use udaf::AggregateExt;
94+
pub use udaf::{AggregateUDF, AggregateUDFImpl, ReversedUDAF};
9695
pub use udf::{ScalarUDF, ScalarUDFImpl};
9796
pub use udwf::{WindowUDF, WindowUDFImpl};
9897
pub use window_frame::{WindowFrame, WindowFrameBound, WindowFrameUnits};

datafusion/expr/src/udaf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,6 @@ impl AggregateUDFImpl for AggregateUDFLegacyWrapper {
655655
}
656656
}
657657

658-
#[deprecated(since = "40.0.0", note="Use ExprFunctionExt instead.")]
658+
#[deprecated(since = "40.0.0", note = "Use ExprFunctionExt instead.")]
659659
// pub trait AggregateExt : ExprFunctionExt {}
660-
pub trait AggregateExt = ExprFunctionExt;
660+
pub trait AggregateExt = ExprFunctionExt;

datafusion/expr/src/udwf.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ impl WindowUDF {
130130
///
131131
/// This utility allows using the UDWF without requiring access to
132132
/// the registry, such as with the DataFrame API.
133-
pub fn call(
134-
&self,
135-
args: Vec<Expr>) -> Expr {
133+
pub fn call(&self, args: Vec<Expr>) -> Expr {
136134
let fun = crate::WindowFunctionDefinition::WindowUDF(Arc::new(self.clone()));
137135

138136
Expr::WindowFunction(WindowFunction::new(fun, args))

datafusion/expr/src/window_function.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ use crate::{expr::WindowFunction, BuiltInWindowFunction, Expr, Literal};
2121

2222
/// Create an expression to represent the `row_number` window function
2323
pub fn row_number() -> Expr {
24-
Expr::WindowFunction(WindowFunction::new(BuiltInWindowFunction::RowNumber, vec![]))
24+
Expr::WindowFunction(WindowFunction::new(
25+
BuiltInWindowFunction::RowNumber,
26+
vec![],
27+
))
2528
}
2629

2730
/// Create an expression to represent the `rank` window function
@@ -31,12 +34,18 @@ pub fn rank() -> Expr {
3134

3235
/// Create an expression to represent the `dense_rank` window function
3336
pub fn dense_rank() -> Expr {
34-
Expr::WindowFunction(WindowFunction::new(BuiltInWindowFunction::DenseRank, vec![]))
37+
Expr::WindowFunction(WindowFunction::new(
38+
BuiltInWindowFunction::DenseRank,
39+
vec![],
40+
))
3541
}
3642

3743
/// Create an expression to represent the `percent_rank` window function
3844
pub fn percent_rank() -> Expr {
39-
Expr::WindowFunction(WindowFunction::new(BuiltInWindowFunction::PercentRank, vec![]))
45+
Expr::WindowFunction(WindowFunction::new(
46+
BuiltInWindowFunction::PercentRank,
47+
vec![],
48+
))
4049
}
4150

4251
/// Create an expression to represent the `cume_dist` window function
@@ -83,5 +92,8 @@ pub fn lead(
8392

8493
/// Create an expression to represent the `nth_value` window function
8594
pub fn nth_value(arg: Expr, n: i64) -> Expr {
86-
Expr::WindowFunction(WindowFunction::new(BuiltInWindowFunction::NthValue, vec![arg, n.lit()]))
95+
Expr::WindowFunction(WindowFunction::new(
96+
BuiltInWindowFunction::NthValue,
97+
vec![arg, n.lit()],
98+
))
8799
}

0 commit comments

Comments
 (0)