xuyangzhong commented on code in PR #26051:
URL: https://github.com/apache/flink/pull/26051#discussion_r1950698484
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/stream/StreamPhysicalRank.scala:
##########
@@ -109,28 +109,34 @@ class StreamPhysicalRank(
.item("select", getRowType.getFieldNames.mkString(", "))
}
- private def getDeduplicateDescription(isRowtime: Boolean, isLastRow:
Boolean): String = {
+ private def getDeduplicateDescription(
+ isRowtime: Boolean,
+ isLastRow: Boolean,
+ insertOnly: Boolean): String = {
val fieldNames = getRowType.getFieldNames
val orderString = if (isRowtime) "ROWTIME" else "PROCTIME"
val keep = if (isLastRow) "LastRow" else "FirstRow"
- s"Deduplicate(keep=[$keep],
key=[${partitionKey.toArray.map(fieldNames.get).mkString(", ")}],
order=[$orderString])"
+ s"Deduplicate(keep=[$keep],
key=[${partitionKey.toArray.map(fieldNames.get).mkString(", ")}],
order=[$orderString], outputInsertOnly=[$insertOnly])"
}
override def translateToExecNode(): ExecNode[_] = {
val generateUpdateBefore = ChangelogPlanUtils.generateUpdateBefore(this)
if (RankUtil.canConvertToDeduplicate(this)) {
val keepLastRow = RankUtil.keepLastDeduplicateRow(orderKey)
+ val tableConfig = unwrapTableConfig(this)
+ val outputInsertOnly =
StreamExecDeduplicate.canBeInsertOnly(tableConfig, keepLastRow)
Review Comment:
Yes you're right!
--
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]