JingsongLi commented on a change in pull request #8898:
[FLINK-12936][table-planner-blink] Support intersect all / minus all to blink
planner
URL: https://github.com/apache/flink/pull/8898#discussion_r298017260
##########
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,
+ new util.ArrayList[RelNode](),
+ builder.call(
+ sqlFunction,
+ builder.fields(Util.range(fields.size() + 1))),
+ function.getElementType(null),
+ UserDefinedFunctionUtils.buildRelDataType(
+ builder.getTypeFactory,
+ logicalType,
+ fieldNames,
+ fieldNames.indices.toArray),
+ null)
+ builder.push(scan)
+
+ // join
Review comment:
actually it is correlated join
----------------------------------------------------------------
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