wuchong commented on a change in pull request #15498:
URL: https://github.com/apache/flink/pull/15498#discussion_r609645166
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/FlinkLogicalRankRule.scala
##########
@@ -98,6 +98,12 @@ abstract class FlinkLogicalRankRuleBase
case _ => throw new TableException(s"Unsupported rank function:
$rankFun")
}
+ // this is to avoid duplicated column name with the input
+ var rankNumberName = rankNumberType.get.getName
+ while (window.getInput.getRowType.getFieldNames.contains(rankNumberName)) {
+ rankNumberName += "$"
Review comment:
When hitting duplicate field names, Calcite ususally append `_<id>`
after it, e.g. `$g_0`, `$g_1`.
What do you think about `rankNumberName += "_0"`?
--
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]