flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhueske <...@git.apache.org>
Subject [GitHub] flink pull request #3862: [FLINK-6483] [table] Support time materialization
Date Wed, 10 May 2017 12:17:45 GMT
Github user fhueske commented on a diff in the pull request:

    --- 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`.

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 infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message