You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Yunfeng Zhou (Jira)" <ji...@apache.org> on 2022/11/22 07:04:00 UTC

[jira] [Created] (FLINK-30130) Table.select lose watermark

Yunfeng Zhou created FLINK-30130:
------------------------------------

             Summary: Table.select lose watermark
                 Key: FLINK-30130
                 URL: https://issues.apache.org/jira/browse/FLINK-30130
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / API
    Affects Versions: 1.15.1
            Reporter: Yunfeng Zhou


Trying to execute the following program
{code:java}
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);

DataStream<Long> stream = env.fromSequence(0, 1000);

Schema schema = Schema.newBuilder()
.column("f0", DataTypes.BIGINT())
.columnByExpression("time_ltz", "TO_TIMESTAMP_LTZ(f0 * 1000, 3)")
.watermark("time_ltz", "time_ltz - INTERVAL '5' SECOND")
.build();
Table table = tEnv.fromDataStream(stream, schema);

table.printSchema();

table = table.select($("*"));

table.printSchema();{code}

Would get the following result


{code:java}
(
  `f0` BIGINT,
  `time_ltz` TIMESTAMP_LTZ(3) *ROWTIME* AS TO_TIMESTAMP_LTZ(f0 * 1000, 3),
  WATERMARK FOR `time_ltz`: TIMESTAMP_LTZ(3) AS time_ltz - INTERVAL '5' SECOND
)
(
  `f0` BIGINT,
  `time_ltz` TIMESTAMP_LTZ(3) *ROWTIME*
)
{code}

This result shows that the watermark property of a Table is lost during select operation.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)