leonardBang commented on a change in pull request #15303:
URL: https://github.com/apache/flink/pull/15303#discussion_r601100038
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/CodeGeneratorContext.scala
##########
@@ -481,6 +511,79 @@ class CodeGeneratorContext(val tableConfig: TableConfig) {
fieldTerm
}
+ /**
+ * Adds a reusable session-level time to the beginning of the SAM of
+ * the generated [[Function]].
+ */
+ def addReusableSessionTime(): String = {
+ val fieldTerm = s"sessionTime"
+
+ val sessionTimestamp = addReusableSessionTimestamp()
+ reusableMemberStatements.add(
+ s"""
+ |private static final int $fieldTerm = (int)
+ | ($sessionTimestamp.getMillisecond() % ${DateTimeUtils.MILLIS_PER_DAY})
< 0 ?
Review comment:
I think the optimization can work only If we agree there's no case that
current millisecond will be small than zero, I tend to keep the check because
if user set wrong JVM time flink should still work
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]