Skip to content

Commit eef5e2d

Browse files
authored
Rename NthValue::{first_value,last_value,nth_value} to satisfy clippy (#986)
1 parent 141aed5 commit eef5e2d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

datafusion/src/physical_plan/expressions/nth_value.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub struct NthValue {
5050

5151
impl NthValue {
5252
/// Create a new FIRST_VALUE window aggregate function
53-
pub fn first_value(
53+
pub fn first(
5454
name: impl Into<String>,
5555
expr: Arc<dyn PhysicalExpr>,
5656
data_type: DataType,
@@ -64,7 +64,7 @@ impl NthValue {
6464
}
6565

6666
/// Create a new LAST_VALUE window aggregate function
67-
pub fn last_value(
67+
pub fn last(
6868
name: impl Into<String>,
6969
expr: Arc<dyn PhysicalExpr>,
7070
data_type: DataType,
@@ -78,7 +78,7 @@ impl NthValue {
7878
}
7979

8080
/// Create a new NTH_VALUE window aggregate function
81-
pub fn nth_value(
81+
pub fn nth(
8282
name: impl Into<String>,
8383
expr: Arc<dyn PhysicalExpr>,
8484
data_type: DataType,
@@ -218,7 +218,7 @@ mod tests {
218218

219219
#[test]
220220
fn first_value() -> Result<()> {
221-
let first_value = NthValue::first_value(
221+
let first_value = NthValue::first(
222222
"first_value".to_owned(),
223223
Arc::new(Column::new("arr", 0)),
224224
DataType::Int32,
@@ -229,7 +229,7 @@ mod tests {
229229

230230
#[test]
231231
fn last_value() -> Result<()> {
232-
let last_value = NthValue::last_value(
232+
let last_value = NthValue::last(
233233
"last_value".to_owned(),
234234
Arc::new(Column::new("arr", 0)),
235235
DataType::Int32,
@@ -240,7 +240,7 @@ mod tests {
240240

241241
#[test]
242242
fn nth_value_1() -> Result<()> {
243-
let nth_value = NthValue::nth_value(
243+
let nth_value = NthValue::nth(
244244
"nth_value".to_owned(),
245245
Arc::new(Column::new("arr", 0)),
246246
DataType::Int32,
@@ -252,7 +252,7 @@ mod tests {
252252

253253
#[test]
254254
fn nth_value_2() -> Result<()> {
255-
let nth_value = NthValue::nth_value(
255+
let nth_value = NthValue::nth(
256256
"nth_value".to_owned(),
257257
Arc::new(Column::new("arr", 0)),
258258
DataType::Int32,

datafusion/src/physical_plan/windows/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,19 @@ fn create_built_in_window_expr(
129129
.map_err(|e| DataFusionError::Execution(format!("{:?}", e)))?;
130130
let n: u32 = n as u32;
131131
let data_type = args[0].data_type(input_schema)?;
132-
Arc::new(NthValue::nth_value(name, arg, data_type, n)?)
132+
Arc::new(NthValue::nth(name, arg, data_type, n)?)
133133
}
134134
BuiltInWindowFunction::FirstValue => {
135135
let arg =
136136
coerce(args, input_schema, &signature_for_built_in(fun))?[0].clone();
137137
let data_type = args[0].data_type(input_schema)?;
138-
Arc::new(NthValue::first_value(name, arg, data_type))
138+
Arc::new(NthValue::first(name, arg, data_type))
139139
}
140140
BuiltInWindowFunction::LastValue => {
141141
let arg =
142142
coerce(args, input_schema, &signature_for_built_in(fun))?[0].clone();
143143
let data_type = args[0].data_type(input_schema)?;
144-
Arc::new(NthValue::last_value(name, arg, data_type))
144+
Arc::new(NthValue::last(name, arg, data_type))
145145
}
146146
_ => {
147147
return Err(DataFusionError::NotImplemented(format!(

0 commit comments

Comments
 (0)