flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] KurtYoung commented on a change in pull request #8109: [FLINK-12017][table-planner-blink] Support translation from Rank/Deduplicate to StreamTransformation
Date Fri, 12 Apr 2019 10:34:38 GMT
KurtYoung commented on a change in pull request #8109: [FLINK-12017][table-planner-blink] Support
translation from Rank/Deduplicate to StreamTransformation
URL: https://github.com/apache/flink/pull/8109#discussion_r274846133
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/nodes/physical/stream/StreamExecDeduplicate.scala
 ##########
 @@ -73,4 +94,91 @@ class StreamExecDeduplicate(
       .item("order", orderString)
   }
 
+  //~ ExecNode methods -----------------------------------------------------------
+
+  override protected def translateToPlanInternal(
+      tableEnv: StreamTableEnvironment): StreamTransformation[BaseRow] = {
+
+    val inputIsAccRetract = StreamExecRetractionRules.isAccRetract(getInput)
+
+    if (inputIsAccRetract) {
+      throw new TableException(
+        "Deduplicate: Retraction on Deduplicate is not supported yet.\n" +
+          "please re-check sql grammar. \n" +
+          "Note: Deduplicate should not follow a non-windowed GroupBy aggregation.")
+    }
+
+    val inputTransform = getInputNodes.get(0).translateToPlan(tableEnv)
+      .asInstanceOf[StreamTransformation[BaseRow]]
+
+    val rowTypeInfo = inputTransform.getOutputType.asInstanceOf[BaseRowTypeInfo]
+
+    val generateRetraction = StreamExecRetractionRules.isAccRetract(this)
+
+    val inputRowType = FlinkTypeFactory.toInternalRowType(getInput.getRowType)
+    val rowTimeFieldIndex = inputRowType.getFieldTypes.zipWithIndex
+      .filter(e => isRowTime(e._1))
+      .map(_._2)
+    if (rowTimeFieldIndex.size > 1) {
+      throw new RuntimeException("More than one row time field. Currently this is not supported!")
 
 Review comment:
   If we don't support order by rowtime now, we can just remove all rowtime related stuffs
in this operator, .e.g `isRowtime` in constructor. And make sure only order by proctime can
be translated to this in rule.

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


With regards,
Apache Git Services

Mime
View raw message