mihaibudiu commented on code in PR #3936:
URL: https://github.com/apache/calcite/pull/3936#discussion_r1739201090
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -5185,6 +5187,61 @@ void testBitGetFunc(SqlOperatorFixture f, String
functionName) {
}
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6551">[CALCITE-6551]
+ * Add DATE_FORMAT function (enabled in MySQL library)</a>. */
+ @Test void testDateFormat() {
+ final SqlOperatorFixture f = fixture()
+ .withTester(t -> TESTER).withLibrary(SqlLibrary.MYSQL);
+ f.setFor(SqlLibraryOperators.DATE_FORMAT);
+ final Locale originalLocale = Locale.getDefault();
+
+ try {
+ Locale.setDefault(Locale.US);
Review Comment:
There are three distinct data types in Calcite:
TIMESTAMP
TIMESTAMP WITH LOCAL TIME ZONE
TIMESTAMP WITH TIME ZONE
You have to specify the type these functions operate on. I think you
probably want functions for each data type. The ones for TIMESTAMP and
TIMESTAMP WITH TIMEZONE should be deterministic. And the ones for LOCAL TIME
ZONE should be implemented in terms of the other ones by setting the timezone
first. But you should not rely on the Java system timezone for this.
--
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]