wuchong commented on a change in pull request #10693: [FLINK-15334][table sql / 
api] Fix physical schema mapping in TableFormatFactoryBase to support define 
orderless computed column
URL: https://github.com/apache/flink/pull/10693#discussion_r362164397
 
 

 ##########
 File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFormatFactoryBase.java
 ##########
 @@ -157,36 +156,33 @@ public static TableSchema deriveSchema(Map<String, 
String> properties) {
                final TableSchema.Builder builder = TableSchema.builder();
 
                final TableSchema tableSchema = 
descriptorProperties.getTableSchema(SCHEMA);
-               final TableSchema physicalSchema = 
TableSchemaUtils.getPhysicalSchema(tableSchema);
-
-               final Map<Integer, Integer> physicalIndices2Indices = 
Arrays.stream(physicalSchema.getFieldNames())
-                       .collect(Collectors.toMap(
-                               
Arrays.asList(physicalSchema.getFieldNames())::indexOf,
-                               
Arrays.asList(tableSchema.getFieldNames())::indexOf));
-
-               for (int i = 0; i < physicalSchema.getFieldCount(); i++) {
-                       final String fieldName = 
physicalSchema.getFieldNames()[i];
-                       final DataType fieldType = 
physicalSchema.getFieldDataTypes()[i];
-
+               for (int i = 0; i < tableSchema.getFieldCount(); i++) {
+                       final String fieldName = tableSchema.getFieldNames()[i];
+                       final DataType fieldType = 
tableSchema.getFieldDataTypes()[i];
+
+                       final Optional<TableColumn> tableColumn = 
tableSchema.getTableColumn(fieldName);
+                       final boolean isGeneratedColumn = 
tableColumn.isPresent() && tableColumn.get().isGenerated();
 
 Review comment:
   Please update here as above.

----------------------------------------------------------------
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

Reply via email to