You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ag...@apache.org on 2022/07/18 00:01:51 UTC

[arrow-datafusion] branch master updated: Add pow as synonym for power (#2927)

This is an automated email from the ASF dual-hosted git repository.

agrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new cb95042c5 Add pow as synonym for power (#2927)
cb95042c5 is described below

commit cb95042c507ea0994c248349e9d6093feaae37a0
Author: Andy Grove <ag...@apache.org>
AuthorDate: Sun Jul 17 18:01:46 2022 -0600

    Add pow as synonym for power (#2927)
---
 datafusion/core/tests/sql/functions.rs   | 4 ++--
 datafusion/expr/src/built_in_function.rs | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/datafusion/core/tests/sql/functions.rs b/datafusion/core/tests/sql/functions.rs
index 1710e9af4..4b58b379e 100644
--- a/datafusion/core/tests/sql/functions.rs
+++ b/datafusion/core/tests/sql/functions.rs
@@ -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;
diff --git a/datafusion/expr/src/built_in_function.rs b/datafusion/expr/src/built_in_function.rs
index 052fa7ace..323963c56 100644
--- a/datafusion/expr/src/built_in_function.rs
+++ b/datafusion/expr/src/built_in_function.rs
@@ -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,