yuchengxin commented on code in PR #22767:
URL: https://github.com/apache/flink/pull/22767#discussion_r1241117924
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/PushWatermarkIntoTableSourceScanRuleBase.java:
##########
@@ -117,8 +130,37 @@ protected FlinkLogicalTableSourceScan getNewScan(
idleTimeoutMillis = -1L;
}
+ Optional<RelHint> optionsHintOptional =
+ scan.getHints().stream()
+ .filter(
+ relHint ->
+ relHint.hintName.equalsIgnoreCase(
+
FlinkHints.HINT_NAME_OPTIONS))
+ .findFirst();
+ Configuration hintOptions = new Configuration();
+ if (optionsHintOptional.isPresent()) {
+ RelHint optionsHint = optionsHintOptional.get();
+ hintOptions = Configuration.fromMap(optionsHint.kvOptions);
+ }
+ Configuration tableOptions = new Configuration();
+ RelOptTable table = scan.getTable();
+ if (table instanceof TableSourceTable) {
+ Map<String, String> tableConfigs =
+ ((TableSourceTable) table)
+ .contextResolvedTable()
+ .getResolvedTable()
+ .getOptions();
+ tableOptions = Configuration.fromMap(tableConfigs);
+ }
+ Optional<WatermarkParams> watermarkParamsOptional =
+ parseWatermarkParams(hintOptions, tableOptions);
+
final WatermarkPushDownSpec watermarkPushDownSpec =
- new WatermarkPushDownSpec(watermarkExpr,
idleTimeoutMillis, producedType);
+ new WatermarkPushDownSpec(
+ watermarkExpr,
+ idleTimeoutMillis,
+ producedType,
+ watermarkParamsOptional.orElse(null));
Review Comment:
I hive modified the method `parseWatermarkParams` to return
`WatermarkParams`.
However, the `watermarkParams` in `WatermarkPushDownSpec ` must be nullable
for compatibility.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]