cjj2010 commented on code in PR #4703:
URL: https://github.com/apache/calcite/pull/4703#discussion_r2646728096


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java:
##########
@@ -1027,6 +1028,8 @@ void populate2() {
       define(FORMAT_TIME, datetimeFormatImpl);
       define(FORMAT_TIMESTAMP, datetimeFormatImpl);
 
+      defineReflective(AGE_PG, BuiltInMethod.AGE.method, 
BuiltInMethod.AGE_ONE_PARAM.method);

Review Comment:
   > If we can support variable input parameters in a single execution 
function, then we wouldn't need to use `defineReflective` here, would we? Also, 
I noticed that DuckDB also supports this function; could we support it as well, 
and stop using the name `AGE_PG`?
   > 
   > ```
   > duckdb> SELECT AGE(timestamp '2023-12-25 08:08:08.080', timestamp 
'2020-01-01') FROM (VALUES (1)) t;
   > 
┌────────────────────────────────────────────────────────────────────────────────────┐
   > │ age(CAST('2023-12-25 08:08:08.080' AS TIMESTAMP), CAST('2020-01-01' AS 
TIMESTAMP)) │
   > 
╞════════════════════════════════════════════════════════════════════════════════════╡
   > │ 0 years 47 mons 24 days 8 hours 8 mins 8.080000000 secs                  
          │
   > 
└────────────────────────────────────────────────────────────────────────────────────┘
   > ```
   
   I strongly agree with this suggestion, done,thanks



-- 
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]

Reply via email to