You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/06/27 04:35:02 UTC

[GitHub] [flink] godfreyhe commented on a change in pull request #8898: [FLINK-12936][table-planner-blink] Support intersect/minus all to blink planner

godfreyhe commented on a change in pull request #8898: [FLINK-12936][table-planner-blink] Support intersect/minus all to blink planner
URL: https://github.com/apache/flink/pull/8898#discussion_r297963859
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/rules/logical/ReplaceSetOpWithJoinRuleBase.scala
 ##########
 @@ -55,4 +71,47 @@ abstract class ReplaceSetOpWithJoinRuleBase[T <: SetOp](
     }
     conditions
   }
+
+  protected def replicateRows(
+      builder: RelBuilder, outputType: RelDataType, fields: util.List[Integer]): RelNode = {
+    // construct LogicalTableFunctionScan
+    val logicalType = toLogicalRowType(outputType)
+    val fieldNames = outputType.getFieldNames.toSeq.toArray
+    val fieldTypes = toLogicalRowType(outputType)
+        .getChildren.map(fromLogicalTypeToTypeInfo).toArray
+    val tf = new ReplicateRows(fieldTypes)
+    val resultType = fromLegacyInfoToDataType(new RowTypeInfo(fieldTypes, fieldNames))
+    val function = new TypedFlinkTableFunction(tf, resultType)
+    val typeFactory = builder.getTypeFactory.asInstanceOf[FlinkTypeFactory]
+    val sqlFunction = new TableSqlFunction(
+      tf.functionIdentifier,
+      tf.toString,
+      tf,
+      resultType,
+      typeFactory,
+      function)
+
+    val scan = LogicalTableFunctionScan.create(
+      builder.peek().getCluster,
 
 Review comment:
   create a `cluster` variable ? as `builder.peek().getCluster` is used twice

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