kasakrisz commented on code in PR #5757:
URL: https://github.com/apache/hive/pull/5757#discussion_r2039009489


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveUnixTimestampSqlOperator.java:
##########
@@ -29,13 +29,9 @@
  */
 public class HiveUnixTimestampSqlOperator {
   public static final SqlFunction INSTANCE =
-      new SqlFunction("UNIX_TIMESTAMP", SqlKind.OTHER_FUNCTION, 
ReturnTypes.BIGINT, null,
+      new HiveSqlFunction("UNIX_TIMESTAMP", SqlKind.OTHER_FUNCTION, 
ReturnTypes.BIGINT, null,
           OperandTypes.or(OperandTypes.NILADIC,
               OperandTypes.or(OperandTypes.STRING, OperandTypes.TIMESTAMP, 
OperandTypes.DATE),
-              OperandTypes.STRING_STRING), SqlFunctionCategory.NUMERIC) {
-        @Override
-        public boolean isDynamicFunction() {
-          return true;
-        }

Review Comment:
   Yes, you are right, but this is one of the goal of this patch. Otherwise 
`UNIX_TIMESTAMP` doesn't evaluated during constant folding by Calcite.
   
   Caclcite 1.25
   
https://github.com/apache/calcite/blob/68b02dfd4af15bc94a91a0cd2a30655d04439555/core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java#L1094-L1099
   
   From Calcite 1.28 treating dynamic functions as constant or not is 
configurable
   https://issues.apache.org/jira/browse/CALCITE-2736
   
   This is a rule level config though.
   



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to