jeyhunkarimov commented on code in PR #24510:
URL: https://github.com/apache/flink/pull/24510#discussion_r1560115307
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/LogicalUnnestRule.scala:
##########
@@ -73,59 +75,13 @@ class LogicalUnnestRule(operand: RelOptRuleOperand,
description: String)
val outer = getRel(correlate.getLeft)
val array = getRel(correlate.getRight)
- def convert(relNode: RelNode): RelNode = {
- relNode match {
- case rs: HepRelVertex =>
- convert(getRel(rs))
-
- case f: LogicalProject =>
- f.copy(f.getTraitSet, ImmutableList.of(convert(getRel(f.getInput))))
-
- case f: LogicalFilter =>
- f.copy(f.getTraitSet, ImmutableList.of(convert(getRel(f.getInput))))
-
- case uc: Uncollect =>
- // convert Uncollect into TableFunctionScan
- val cluster = correlate.getCluster
- val typeFactory = ShortcutUtils.unwrapTypeFactory(cluster)
- val relDataType = uc.getInput.getRowType.getFieldList.get(0).getValue
- val logicalType = FlinkTypeFactory.toLogicalType(relDataType)
-
- val sqlFunction =
- BridgingSqlFunction.of(cluster,
BuiltInFunctionDefinitions.INTERNAL_UNNEST_ROWS)
-
- val rexCall = cluster.getRexBuilder.makeCall(
- typeFactory.createFieldTypeFromLogicalType(
- toRowType(UnnestRowsFunction.getUnnestedType(logicalType))),
- sqlFunction,
- getRel(uc.getInput).asInstanceOf[LogicalProject].getProjects
- )
-
- new LogicalTableFunctionScan(
- cluster,
- correlate.getTraitSet,
- Collections.emptyList(),
- rexCall,
- null,
- rexCall.getType,
- null)
- }
- }
-
// convert unnest into table function scan
- val tableFunctionScan = convert(array)
+ val tableFunctionScan = convert(array, correlate.getCluster,
correlate.getTraitSet)
Review Comment:
Yes, after the rebase
([FLINK-34162](https://issues.apache.org/jira/browse/FLINK-34162)) it is
unchanged.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]