Skip to content

Commit 7201fec

Browse files
author
Jiayu Liu
committed
fix test
1 parent 25ba12b commit 7201fec

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

datafusion/src/physical_plan/window_functions.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl FromStr for WindowFunction {
4949
Ok(WindowFunction::BuiltInWindowFunction(built_in_function))
5050
} else {
5151
Err(DataFusionError::Plan(format!(
52-
"There is no built-in function named {}",
52+
"There is no window function named {}",
5353
name
5454
)))
5555
}
@@ -292,6 +292,15 @@ mod tests {
292292
Ok(())
293293
}
294294

295+
#[test]
296+
fn test_nth_value_return_type() -> Result<()> {
297+
let fun = WindowFunction::from_str("nth_value")?;
298+
let observed = return_type(&fun, &[DataType::Utf8])?;
299+
assert_eq!(DataType::Utf8, observed);
300+
301+
Ok(())
302+
}
303+
295304
#[test]
296305
fn test_cume_dist_return_type() -> Result<()> {
297306
let fun = WindowFunction::from_str("cume_dist")?;

datafusion/src/sql/planner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2746,7 +2746,7 @@ mod tests {
27462746
let sql = "SELECT order_id, MAX(delivered) OVER (order BY order_id) from orders";
27472747
let err = logical_plan(sql).expect_err("query should have failed");
27482748
assert_eq!(
2749-
"NotImplemented(\"Unsupported OVER clause (PARTITION BY order_id)\")",
2749+
"NotImplemented(\"Unsupported OVER clause (ORDER BY order_id)\")",
27502750
format!("{:?}", err)
27512751
);
27522752
}

0 commit comments

Comments
 (0)