cjj2010 commented on code in PR #4703:
URL: https://github.com/apache/calcite/pull/4703#discussion_r2639024481
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -6948,6 +6948,105 @@ void checkRegexpExtract(SqlOperatorFixture f0,
FunctionAlias functionAlias) {
f.checkNull("json_storage_size(cast(null as varchar))");
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-7337">[CALCITE-7337]
+ * AGE function with timestamp arguments</a>. */
+ @Test void testAgePg() {
+ final SqlOperatorFixture f0 = fixture();
+ f0.checkFails("^age(timestamp '2023-12-25', timestamp '2020-01-01')^",
+ "No match found for function signature AGE\\(<TIMESTAMP>,
<TIMESTAMP>\\)", false);
+
+ final SqlOperatorFixture f = f0.withLibrary(SqlLibrary.POSTGRESQL);
+
+ // Test two timestamp arguments
+ f.checkScalar("age(timestamp '2023-12-25', timestamp '2020-01-01')",
Review Comment:
yes,PG also returned "3 years 11 mons 24 days 0 hours 0 mins 0.0 secs"
<img width="733" height="285" alt="image"
src="https://github.com/user-attachments/assets/9179f01e-2b7e-4a63-acbe-7ba2abc6bba1"
/>
--
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]