wuchong commented on a change in pull request #10098:
[FLINK-14326][FLINK-14324][table] Support to apply watermark assigner in planner
URL: https://github.com/apache/flink/pull/10098#discussion_r343524388
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/TableSourceTable.scala
##########
@@ -50,13 +53,29 @@ class TableSourceTable[T](
this(tableSource, isStreamingMode, statistic, None, catalogTable)
}
+ Preconditions.checkNotNull(tableSource)
+ Preconditions.checkNotNull(statistic)
+ Preconditions.checkNotNull(catalogTable)
+
+ val watermarkSpec: Option[WatermarkSpec] = catalogTable
+ .getSchema
+ .getWatermarkSpecs.asScala.headOption
+
+ if (TableSourceValidation.hasRowtimeAttribute(tableSource) &&
watermarkSpec.isDefined) {
Review comment:
Nope. Only when users specify rowtime attributes explicitly via `Rowtime`
descriptor API, the KafkaTableSource will return non-empty
`RowtimeAttributeDescriptor`.
It's fine if a `TableSource` implements `DefinedRowtimeAttributes` but
returns empty `RowtimeAttributeDescriptor` and defines watermark in DDL at the
same time.
I will improve the exception message a bit more.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services