PHILO-HE commented on code in PR #10248:
URL:
https://github.com/apache/incubator-gluten/pull/10248#discussion_r2224959151
##########
gluten-flink/ut/src/test/java/org/apache/gluten/table/runtime/stream/custom/ScalarFunctionsTest.java:
##########
@@ -126,4 +126,14 @@ void testEqual() {
String query4 = "select c = d as x from tblEqual where a > 0";
runAndCheck(query4, Arrays.asList("+I[false]", "+I[true]", "+I[false]"));
}
+
+ @Test
+ void testDateFormat() {
+ List<Row> rows =
+ Arrays.asList(Row.of(1, "2024-12-31 12:12:12"), Row.of(2, "2025-02-28
12:12:12"));
+ createSimpleBoundedValuesTable("dateFormatTbl", "a int, b string", rows);
+ String query =
+ "select a, DATE_FORMAT(cast(b as Timestamp(3)), 'yyyy-MM-dd') from
dateFormatTbl";
Review Comment:
In Spark and Velox, date_format should respect the session timezone. I
assume Flink should also respect it.
The test here cannot expose the issue that local session timezone is not
respected. The default timezone (utc) is used in cast string to timestamp.
Then, the same default timezone is used for date_format. As long as the
timezone is consistent, there is no issue exposed. But the actual timezone
configured for Flink is not actually respected.
I think we need to pass Flink's session timezone to Velox's config, as
Gluten Spark code does.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]