pnowojski commented on a change in pull request #6787: [FLINK-8577][table]
Implement proctime DataStream to Table upsert conversion
URL: https://github.com/apache/flink/pull/6787#discussion_r249057349
##########
File path:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/calcite/RelTimeIndicatorConverter.scala
##########
@@ -215,6 +217,19 @@ class RelTimeIndicatorConverter(rexBuilder: RexBuilder)
extends RelShuttle {
materializerUtils.projectAndMaterializeFields(rewrittenTemporalJoin,
indicesToMaterialize)
}
+ def visit(upsertToRetraction: LogicalUpsertToRetraction): RelNode = {
+ val input = upsertToRetraction.getInput.accept(this)
+ val relTypes = input.getRowType.getFieldList.map(_.getType)
+ val timeIndicatorIndexes = relTypes.zipWithIndex
+ .filter(e => FlinkTypeFactory.isTimeIndicatorType(e._1))
+ .map(_._2).toSet
+
+ val rewrittenInput = input.copy(input.getTraitSet, input.getInputs)
+ val newInput =
+ materializerUtils.projectAndMaterializeFields(rewrittenInput,
timeIndicatorIndexes)
Review comment:
you could extract the lines 222 and 223 to:
```
val materializedInput =
materializerUtils.projectAndMaterializeAllFields(rewrittenInput)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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