raminqaf commented on code in PR #28025:
URL: https://github.com/apache/flink/pull/28025#discussion_r3202570812
##########
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:
I play around with it but tbh I like this approach of fetching the Fields
once and gathering the infos out of it
--
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]