在 DDL 中定义时生成新水印的策略

the policy of new watermark generation when defined in DDL

https://ci.apache.org/projects/flink/flink-docs-release-1.12/dev/table/streaming/time_attributes.html

事件时间属性和水印的 DDL 是:

CREATE TABLE user_actions (
  user_name STRING,
  data STRING,
  user_action_time TIMESTAMP(3),
  -- declare user_action_time as event time attribute and use 5 seconds delayed watermark strategy
  WATERMARK FOR user_action_time AS user_action_time - INTERVAL '5' SECOND
) WITH (
  ...
);

请问新水印生成政策:

对于数据流,flink 提供了以下两种水印生成策略, 在 ddl 中呢?

  1. 周期性地像 AssignerWithPeriodicWatermarks 那样,即尝试周期性地生成新的水印
  2. punctuated like AssignerWithPunctuatedWatermarks,即尝试在新事件到来时生成新水印。

水印是定期分配的。您可以通过配置 pipeline.auto-watermark-interval.

指定间隔

另请注意,水印的 API 在 DataStream API 中已更改,您提到的两个 类 现在已弃用。

[1] https://ci.apache.org/projects/flink/flink-docs-release-1.12/dev/event_timestamps_watermarks.html#introduction-to-watermark-strategies