normanj-bitquill commented on code in PR #3762:
URL: https://github.com/apache/calcite/pull/3762#discussion_r1571315674
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -2216,7 +2216,39 @@ private static RelDataType
deriveTypeMapFromEntries(SqlOperatorBinding opBinding
@LibraryOperator(libraries = {BIG_QUERY, SPARK})
public static final SqlFunction POW =
- SqlStdOperatorTable.POWER.withName("POW");
+ SqlBasicFunction.create("POW",
+ ReturnTypes.DOUBLE_NULLABLE,
+ OperandTypes.NUMERIC_NUMERIC,
+ SqlFunctionCategory.NUMERIC);
+
+ /** The {@code POWER(numeric, numeric)} function.
+ *
+ * <p>The return type is always {@code DOUBLE} since we don't know
+ * what the result type will be by just looking at the operand types. For
+ * example {@code POWER(INTEGER, INTEGER)} can return a non-INTEGER if the
+ * second operand is negative.
+ */
+ @LibraryOperator(libraries = { BIG_QUERY, CALCITE, HIVE, MSSQL, MYSQL,
ORACLE, SNOWFLAKE,
+ SPARK })
+ public static final SqlFunction POWER =
+ SqlBasicFunction.create("POWER",
+ ReturnTypes.DOUBLE_NULLABLE,
+ OperandTypes.NUMERIC_NUMERIC,
+ SqlFunctionCategory.NUMERIC);
+
+ /** The {@code POWER(numeric, numeric)} function.
+ *
+ * <p>The return type is always {@code DOUBLE} since we don't know
Review Comment:
Updated the comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]