Skip to content

Commit

Permalink
Add pow as synonym for power
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Jul 16, 2022
1 parent c528986 commit ee0d85b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions datafusion/core/tests/sql/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ async fn test_power() -> Result<()> {
ctx.register_table("test", Arc::new(table))?;
let sql = r"SELECT power(i32, exp_i) as power_i32,
power(i64, exp_f) as power_i64,
power(f32, exp_i) as power_f32,
pow(f32, exp_i) as power_f32,
power(f64, exp_f) as power_f64,
power(2, 3) as power_int_scalar,
pow(2, 3) as power_int_scalar,
power(2.5, 3.0) as power_float_scalar
FROM (select test.*, 3 as exp_i, 3.0 as exp_f from test) a";
let actual = execute_to_batches(&ctx, sql).await;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/expr/src/built_in_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl FromStr for BuiltinScalarFunction {
"log" => BuiltinScalarFunction::Log,
"log10" => BuiltinScalarFunction::Log10,
"log2" => BuiltinScalarFunction::Log2,
"power" => BuiltinScalarFunction::Power,
"power" | "pow" => BuiltinScalarFunction::Power,
"round" => BuiltinScalarFunction::Round,
"signum" => BuiltinScalarFunction::Signum,
"sin" => BuiltinScalarFunction::Sin,
Expand Down

0 comments on commit ee0d85b

Please sign in to comment.