danny0405 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_r343473123
########## File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java ########## @@ -170,10 +133,9 @@ public TableSchema copy() { * e.g. "field1.innerField2" */ public Optional<DataType> getFieldDataType(String fieldName) { - if (fieldNameToType.containsKey(fieldName)) { - return Optional.of(fieldNameToType.get(fieldName)); - } - return Optional.empty(); + return this.columns.stream() + .filter(column -> column.getName().equals(fieldName)) + .findFirst().map(TableColumn::getType); Review comment: Oops, thanks for pointing it out ! ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services