[
https://issues.apache.org/jira/browse/FLINK-6483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16004574#comment-16004574
]
ASF GitHub Bot commented on FLINK-6483:
---------------------------------------
Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3862#discussion_r115704440
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/CodeGenerator.scala
---
@@ -1840,6 +1859,35 @@ class CodeGenerator(
}
}
+ private[flink] def generateRecordTimestamp(isEventTime: Boolean):
GeneratedExpression = {
+ val resultTerm = newName("result")
+ val nullTerm = newName("isNull")
+ val resultTypeTerm =
primitiveTypeTermForTypeInfo(SqlTimeTypeInfo.TIMESTAMP)
+ val defaultValue = primitiveDefaultValue(SqlTimeTypeInfo.TIMESTAMP)
+
+ if (isEventTime) {
+ val resultCode =
+ s"""
+ |boolean $nullTerm = $contextTerm.timestamp() == null;
--- End diff --
I think we should throw an exception if the timestamp is `null`.
The query only access the timestamp if it explicitly asks for event-time.
If the timestamp is not set, the query should fail, IMO.
As an additional check, we should add a check to the
`StreamTableEnvironment` (and the `TableSourceTable`) that verifies that
event-time is enabled in the `StreamExecutionEnvironment`.
> Support time materialization
> ----------------------------
>
> Key: FLINK-6483
> URL: https://issues.apache.org/jira/browse/FLINK-6483
> Project: Flink
> Issue Type: New Feature
> Components: Table API & SQL
> Reporter: Timo Walther
> Assignee: Timo Walther
>
> FLINK-5884 added support for time indicators. However, there are still some
> features missing i.e. materialization of metadata timestamp.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)