gustavodemorais commented on code in PR #30173:
URL: https://github.com/apache/flink/pull/30173#discussion_r4773209919


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdModifiedMonotonicity.scala:
##########
@@ -281,6 +281,25 @@ class FlinkRelMdModifiedMonotonicity private extends 
MetadataHandler[ModifiedMon
     getMonotonicity(rel.getInput, mq, rel.getRowType.getFieldCount)
   }
 
+  /**
+   * If the filter keeps UPDATE_BEFORE or DELETE rows, the same as for 
DropUpdateBefore. Otherwise
+   * the output has no deletes, so the monotonicity is known:
+   *   - CONSTANT for an insert-only input, whose rows never change.
+   *   - NOT_MONOTONIC otherwise: an update, or a dropped delete followed by a 
new insert of the
+   *     same key, may change any column in either direction.
+   */
+  def getRelModifiedMonotonicity(
+      rel: StreamPhysicalChangelogFilter,
+      mq: RelMetadataQuery): RelModifiedMonotonicity = {
+    val keptRowKinds = rel.getKeptRowKinds
+    if (keptRowKinds.contains(RowKind.UPDATE_BEFORE) || 
keptRowKinds.contains(RowKind.DELETE)) {

Review Comment:
   done



-- 
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]

Reply via email to