Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiayu Liu committed May 21, 2021
1 parent c36c04a commit 4e792e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion datafusion/src/physical_plan/window_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl FromStr for WindowFunction {
Ok(WindowFunction::BuiltInWindowFunction(built_in_function))
} else {
Err(DataFusionError::Plan(format!(
"There is no built-in function named {}",
"There is no window function named {}",
name
)))
}
Expand Down Expand Up @@ -292,6 +292,15 @@ mod tests {
Ok(())
}

#[test]
fn test_nth_value_return_type() -> Result<()> {
let fun = WindowFunction::from_str("nth_value")?;
let observed = return_type(&fun, &[DataType::Utf8])?;
assert_eq!(DataType::Utf8, observed);

Ok(())
}

#[test]
fn test_cume_dist_return_type() -> Result<()> {
let fun = WindowFunction::from_str("cume_dist")?;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/src/sql/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2746,7 +2746,7 @@ mod tests {
let sql = "SELECT order_id, MAX(delivered) OVER (order BY order_id) from orders";
let err = logical_plan(sql).expect_err("query should have failed");
assert_eq!(
"NotImplemented(\"Unsupported OVER clause (PARTITION BY order_id)\")",
"NotImplemented(\"Unsupported OVER clause (ORDER BY order_id)\")",
format!("{:?}", err)
);
}
Expand Down

0 comments on commit 4e792e1

Please sign in to comment.