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:
[email protected]
With regards,
Apache Git Services