snuyanzin commented on code in PR #29493:
URL: https://github.com/apache/flink/pull/29493#discussion_r4459771362
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/JsonGenerateUtils.scala:
##########
@@ -92,6 +92,18 @@ object JsonGenerateUtils {
case TIMESTAMP_WITH_LOCAL_TIME_ZONE =>
s"""$nodeFactoryTerm.textNode($isoTerm + "Z")"""
}
+ case TIME_WITHOUT_TIME_ZONE =>
+ val formatter =
s"${typeTerm(classOf[DateTimeFormatter])}.ISO_LOCAL_TIME"
+ val isoTerm =
+
s"${typeTerm(classOf[DateTimeUtils])}.toLocalTime($valueTerm).format($formatter)"
+ s"$nodeFactoryTerm.textNode($isoTerm)"
+
+ case DATE =>
+ val formatter =
s"${typeTerm(classOf[DateTimeFormatter])}.ISO_LOCAL_DATE"
+ val isoTerm =
+
s"${typeTerm(classOf[DateTimeUtils])}.toLocalDate($valueTerm).format($formatter)"
+ s"$nodeFactoryTerm.textNode($isoTerm)"
Review Comment:
do we really need this code?
can we reuse `DateTimeUtils`?
for instance `DateTimeUtils.formatDate`?
--
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]