Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/2686#discussion_r86138263
--- Diff:
flink-libraries/flink-table/src/test/scala/org/apache/flink/api/table/expressions/ScalarFunctionsTest.scala
---
@@ -377,11 +378,79 @@ class ScalarFunctionsTest extends ExpressionTestBase {
"f4.power(f5)",
"POWER(f4, f5)",
math.pow(44.toLong, 4.5.toFloat).toString)
+
+ // f5: float
+ testAllApis('f5.power('f5), "f5.power(f5)", "power(f5, f5)",
math.pow(4.5F, 4.5F).toString)
+ testAllApis('f5.power('f6), "f5.power(f6)", "power(f5, f6)",
math.pow(4.5F, 4.6D).toString)
+ testAllApis('f5.power('f7), "f5.power(f7)", "power(f5, f7)",
math.pow(4.5F, 3).toString)
+ testAllApis('f5.power('f4), "f5.power(f4)", "power(f5, f4)",
math.pow(4.5F, 44L).toString)
+
+ // f22: bigDecimal
+ // TODO delete casting in SQL when CALCITE-1467 is fixed
+ testAllApis(
+ 'f22.cast(Types.DOUBLE).power('f4),
+ "f22.cast(DOUBLE).power(f5)",
+ "power(CAST(f22 AS DOUBLE), f5)",
+ "1.0")
+
+ testAllApis(
+ 'f22.cast(Types.DOUBLE).power('f5),
+ "f22.cast(DOUBLE).power(f6)",
+ "power(CAST(f22 AS DOUBLE), f6)",
+ "1.0")
+
+ testAllApis(
+ 'f22.cast(Types.DOUBLE).power('f7),
+ "f22.cast(DOUBLE).power(f7)",
+ "power(CAST(f22 AS DOUBLE), f7)",
+ "1.0")
+
+ testAllApis(
+ 'f22.cast(Types.DOUBLE).power('f4),
--- End diff --
Same as above?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---