Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/1322#discussion_r43755112
--- Diff:
flink-staging/flink-table/src/main/scala/org/apache/flink/api/table/codegen/ExpressionCodeGenerator.scala
---
@@ -202,6 +210,23 @@ abstract class ExpressionCodeGenerator[R](
""".stripMargin
}
+ case expressions.Literal(dateValue: Date, DATE_TYPE_INFO) =>
+ val dateName = s"""date_${dateValue.getTime}"""
+ val dateStmt = s"""static java.util.Date $dateName
+ |= new java.util.Date(${dateValue.getTime});""".stripMargin
+ reusableStatements.add(dateStmt)
+
+ if (nullCheck) {
+ s"""
+ |val $nullTerm = false
--- End diff --
Aren't you generating Java code here? This should not work with `val`. I
assume that you don't have a test case where you generate this code. Otherwise
it should have failed. I guess it would be good to add a test case for it.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---