wuchong commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r421914078



##########
File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/trait/UpdateKindTrait.scala
##########
@@ -95,4 +98,17 @@ object UpdateKindTrait {
     }
     new UpdateKindTrait(updateKind)
   }
+
+  /**
+   * Creates an instance of [[UpdateKindTrait]] from the given 
[[ChangelogMode]].
+   */
+  def fromChangelogMode(changelogMode: ChangelogMode): UpdateKindTrait = {
+    val hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE)
+    val hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER)
+    (hasUpdateBefore, hasUpdateAfter) match {
+      case (true, true) => BEFORE_AND_AFTER
+      case (false, true) => ONLY_UPDATE_AFTER
+      case _ => NONE
+    }

Review comment:
       OK. I will throw exception for `true, false`, but keep `NONE` for 
`false, false`. 




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to