Code review comment: we can optimize to: ``` final GeneratedRecordEqualiser generatedEqualiser =                 new EqualiserCodeGenerator(                         rowTypeInfo.toRowType().getFields().stream()                                 .map(RowType.RowField::getType)                                 .toArray(LogicalType[]::new))                         .generateRecordEqualiser("DeduplicateRowEqualiser"); ```

Code before review:
protected Transformation<RowData> translateToPlanInternal(PlannerBase planner) {
final ExecEdge inputEdge = getInputEdges().get(0);
final Transformation<RowData> inputTransform =
(Transformation<RowData>) inputEdge.translateToPlan(planner);
final InternalTypeInfo<RowData> rowTypeInfo =
(InternalTypeInfo<RowData>) inputTransform.getOutputType();
final OneInputStreamOperator<RowData, RowData> operator;
final TableConfig tableConfig = planner.getTableConfig();
final long stateIdleTime = tableConfig.getIdleStateRetention().toMillis();
final boolean isMiniBatchEnabled =
tableConfig
.getConfiguration()
.getBoolean(ExecutionConfigOptions.TABLE_EXEC_MINIBATCH_ENABLED);
final EqualiserCodeGenerator equaliserCodeGen =
new EqualiserCodeGenerator(
rowTypeInfo.toRowType().getFields().stream()
.map(RowType.RowField::getType)
.toArray(LogicalType[]::new));
GeneratedRecordEqualiser generatedEqualiser =
equaliserCodeGen.generateRecordEqualiser("DeduplicateRowEqualiser");
if (isMiniBatchEnabled) {
TypeSerializer<RowData> rowSerializer =
rowTypeInfo.createSerializer(planner.getExecEnv().getConfig());
ProcTimeMiniBatchDeduplicateKeepLastRowFunction processFunction =
new ProcTimeMiniBatchDeduplicateKeepLastRowFunction(
rowTypeInfo,
rowSerializer,
stateIdleTime,
generateUpdateBefore,
true,
false,
generatedEqualiser);
CountBundleTrigger<RowData> trigger = AggregateUtil.createMiniBatchTrigger(tableConfig);
operator = new KeyedMapBundleOperator<>(processFunction, trigger);
} else {
ProcTimeDeduplicateKeepLastRowFunction processFunction =
new ProcTimeDeduplicateKeepLastRowFunction(
rowTypeInfo,
stateIdleTime,
generateUpdateBefore,
true,
false,
generatedEqualiser);
operator = new KeyedProcessOperator<>(processFunction);
}
final OneInputTransformation<RowData, RowData> transform =
new OneInputTransformation<>(
inputTransform,
getDescription(),
operator,
rowTypeInfo,
inputTransform.getParallelism());
if (inputsContainSingleton()) {
transform.setParallelism(1);
transform.setMaxParallelism(1);
}
final RowDataKeySelector selector =
KeySelectorUtil.getRowDataSelector(uniqueKeys, rowTypeInfo);
transform.setStateKeySelector(selector);
transform.setStateKeyType(selector.getProducedType());
return transform;
}

Line under review: rowTypeInfo.toRowType().getFields().stream()

Code after addressing the review:
protected Transformation<RowData> translateToPlanInternal(PlannerBase planner) {
final ExecEdge inputEdge = getInputEdges().get(0);
final Transformation<RowData> inputTransform =
(Transformation<RowData>) inputEdge.translateToPlan(planner);
final InternalTypeInfo<RowData> rowTypeInfo =
(InternalTypeInfo<RowData>) inputTransform.getOutputType();
final OneInputStreamOperator<RowData, RowData> operator;
final TableConfig tableConfig = planner.getTableConfig();
final long stateIdleTime = tableConfig.getIdleStateRetention().toMillis();
final boolean isMiniBatchEnabled =
tableConfig
.getConfiguration()
.getBoolean(ExecutionConfigOptions.TABLE_EXEC_MINIBATCH_ENABLED);
GeneratedRecordEqualiser generatedEqualiser =
new EqualiserCodeGenerator(rowTypeInfo.toRowType())
.generateRecordEqualiser("DeduplicateRowEqualiser");
if (isMiniBatchEnabled) {
TypeSerializer<RowData> rowSerializer =
rowTypeInfo.createSerializer(planner.getExecEnv().getConfig());
ProcTimeMiniBatchDeduplicateKeepLastRowFunction processFunction =
new ProcTimeMiniBatchDeduplicateKeepLastRowFunction(
rowTypeInfo,
rowSerializer,
stateIdleTime,
generateUpdateBefore,
true,
false,
generatedEqualiser);
CountBundleTrigger<RowData> trigger = AggregateUtil.createMiniBatchTrigger(tableConfig);
operator = new KeyedMapBundleOperator<>(processFunction, trigger);
} else {
ProcTimeDeduplicateKeepLastRowFunction processFunction =
new ProcTimeDeduplicateKeepLastRowFunction(
rowTypeInfo,
stateIdleTime,
generateUpdateBefore,
true,
false,
generatedEqualiser);
operator = new KeyedProcessOperator<>(processFunction);
}
final OneInputTransformation<RowData, RowData> transform =
new OneInputTransformation<>(
inputTransform,
getDescription(),
operator,
rowTypeInfo,
inputTransform.getParallelism());
if (inputsContainSingleton()) {
transform.setParallelism(1);
transform.setMaxParallelism(1);
}
final RowDataKeySelector selector =
KeySelectorUtil.getRowDataSelector(uniqueKeys, rowTypeInfo);
transform.setStateKeySelector(selector);
transform.setStateKeyType(selector.getProducedType());
return transform;
}