hequn8128 commented on a change in pull request #8664: [FLINK-12779][table]
Avoid field conflicts when generate field names for non-composite
Typeinformation
URL: https://github.com/apache/flink/pull/8664#discussion_r294211616
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/typeutils/FieldInfoUtils.java
##########
@@ -186,6 +186,37 @@ public static boolean
isReferenceByPosition(CompositeType<?> ct, Expression[] fi
return fieldNames;
}
+ /**
+ * Returns field names for a given {@link TypeInformation}. If the
input {@link TypeInformation}
+ * is not a composite type, the result field name should not exist in
the invalidNamesForNonCompositeType.
+ *
+ * @param inputType The TypeInformation extract the field names.
+ * @param invalidNamesForNonCompositeType The invalid field names for
non-composite types.
+ * @param <A> The type of the TypeInformation.
+ * @return An array holding the field names
+ */
+ public static <A> String[] getFieldNames(TypeInformation<A> inputType,
List<String> invalidNamesForNonCompositeType) {
Review comment:
Good idea!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services