KurtYoung commented on a change in pull request #10096:
[FLINK-14623][table-api] Add computed column information into TableSc…
URL: https://github.com/apache/flink/pull/10096#discussion_r342953235
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java
##########
@@ -346,22 +318,137 @@ public static Builder builder() {
return new Builder();
}
+ //~ Tools
------------------------------------------------------------------
+
+ /**
+ * Tools method to transform arrays of table names and types
+ * into a {@link TableColumn} list.
+ */
+ private static List<TableColumn> getTableColumns(
+ String[] fieldNames,
+ TypeInformation<?>[] fieldTypes) {
+ DataType[] fieldDataTypes =
fromLegacyInfoToDataType(fieldTypes);
+ validateFields(fieldNames, fieldDataTypes);
Review comment:
IIUC your purpose here is validate before/when constructing `TableSchema`,
right? I noticed there is only one place calling this method, which is `public
TableSchema(String[] fieldNames, TypeInformation<?>[] fieldTypes)`.
If this is true, I would suggest move this validation out of this method.
----------------------------------------------------------------
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