[ 
https://issues.apache.org/jira/browse/FLINK-30130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17677130#comment-17677130
 ] 

Jark Wu commented on FLINK-30130:
---------------------------------

Sorry [~yunfengzhou] [~kamalesh0420], I don't think this is a problem or bug. 
This is by design that watermark **definition** can't be propagated as the 
referenced columns might not be selected in the current view/table. But the 
printed schema shows the "ROWTIME" attribute, which users can use to do 
windowing. You can also use "TUMBLE_ROWTIME" to generate a new rowtime 
attribute (and watermark implicitly) for the next rowtime-based operations. 
Therefore, from the perspective of users, there is enough information in the 
printed schema, and this doesn't affect users using rowtime-based operations. 

Please reopen the issue if you still have questions. 

> 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
>            Priority: Major
>
> 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)

Reply via email to