lincoln-lil commented on code in PR #21897:
URL: https://github.com/apache/flink/pull/21897#discussion_r1124356820


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TableSchemaUtils.java:
##########
@@ -68,6 +68,36 @@ public static TableSchema getPhysicalSchema(TableSchema 
tableSchema) {
         return builder.build();
     }
 
+    /**
+     * Return {@link TableSchema} which consists of all persisted columns. 
That means, the virtual
+     * computed columns and metadata columns are filterd out.

Review Comment:
   nit: -> filtered



##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TableSchemaUtils.java:
##########
@@ -68,6 +68,36 @@ public static TableSchema getPhysicalSchema(TableSchema 
tableSchema) {
         return builder.build();
     }
 
+    /**
+     * Return {@link TableSchema} which consists of all persisted columns. 
That means, the virtual
+     * computed columns and metadata columns are filterd out.
+     *
+     * <p>Readers(or writers) such as {@link TableSource} and {@link 
TableSink} should use this
+     * persisted schema to generate {@link TableSource#getProducedDataType()} 
and {@link

Review Comment:
   Users should know the difference between this method and  `getPhysicalSchema`



##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TableSchemaUtils.java:
##########
@@ -68,6 +68,36 @@ public static TableSchema getPhysicalSchema(TableSchema 
tableSchema) {
         return builder.build();
     }
 
+    /**
+     * Return {@link TableSchema} which consists of all persisted columns. 
That means, the virtual
+     * computed columns and metadata columns are filterd out.
+     *
+     * <p>Readers(or writers) such as {@link TableSource} and {@link 
TableSink} should use this
+     * persisted schema to generate {@link TableSource#getProducedDataType()} 
and {@link
+     * TableSource#getTableSchema()} rather than using the raw TableSchema 
which may contains
+     * additional columns.
+     */
+    public static TableSchema getPersistedSchema(TableSchema tableSchema) {

Review Comment:
   we'd better extract a common method for this and `getPhysicalSchema` since 
only one condition differs



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

Reply via email to