raminqaf commented on code in PR #28025:
URL: https://github.com/apache/flink/pull/28025#discussion_r3200082401
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/FromChangelogTypeStrategy.java:
##########
@@ -156,23 +158,24 @@ private static Optional<List<DataType>> validateOpColumn(
final CallContext callContext, final boolean throwOnFailure) {
final TableSemantics tableSemantics =
callContext.getTableSemantics(ARG_TABLE).get();
- final String opColumnName = resolveOpColumnName(callContext);
+ final String opColumnName =
ChangelogTypeStrategyUtils.resolveOpColumnName(callContext);
final List<Field> inputFields =
DataType.getFields(tableSemantics.dataType());
- final Optional<Field> opField =
- inputFields.stream().filter(f ->
f.getName().equals(opColumnName)).findFirst();
- if (opField.isEmpty()) {
+ final OptionalInt opIndex = resolveOpColumnIndex(inputFields,
opColumnName);
Review Comment:
Good point, but down the line we use the type
```java
final Field opField = inputFields.get(opIndex.getAsInt());
final LogicalType opFieldType =
opField.getDataType().getLogicalType();
```
--
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]