You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "julianhyde (via GitHub)" <gi...@apache.org> on 2023/01/25 01:13:43 UTC

[GitHub] [calcite] julianhyde commented on a diff in pull request #3041: [CALCITE-5491] Allow TIME and DATE to be args for TIMESTAMPDIFF

julianhyde commented on code in PR #3041:
URL: https://github.com/apache/calcite/pull/3041#discussion_r1086107019


##########
core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java:
##########
@@ -1903,8 +1903,23 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable {
   /** The <code>TIMESTAMPDIFF</code> function. */
   public static final SqlFunction TIMESTAMP_DIFF =
       new SqlTimestampDiffFunction("TIMESTAMPDIFF",
-          OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.TIMESTAMP,
-              SqlTypeFamily.TIMESTAMP));
+          OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.TIMESTAMP, SqlTypeFamily.TIMESTAMP)
+              .or(

Review Comment:
   how about just
   ```
   OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.DATETIME,
               SqlTypeFamily.DATETIME)
   ```
   which is the code that was removed in bc4cfa32 ?



-- 
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: commits-unsubscribe@calcite.apache.org

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