You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "yuzelin (via GitHub)" <gi...@apache.org> on 2023/04/21 02:45:07 UTC

[GitHub] [incubator-paimon] yuzelin commented on a diff in pull request #964: [flink] Support showing physical column comments for DESC statement

yuzelin commented on code in PR #964:
URL: https://github.com/apache/incubator-paimon/pull/964#discussion_r1173251003


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java:
##########
@@ -364,13 +366,33 @@ public static Schema fromCatalogTable(CatalogTable catalogTable) {
         }
 
         return new Schema(
-                toDataType(rowType).getFields(),
+                addColumnComments(toDataType(rowType).getFields(), getColumnComments(catalogTable)),
                 catalogTable.getPartitionKeys(),
                 primaryKeys,
                 options,
                 catalogTable.getComment());
     }
 
+    private static Map<String, String> getColumnComments(CatalogTable catalogTable) {
+        return catalogTable.getUnresolvedSchema().getColumns().stream()
+                .filter(c -> c.getComment().isPresent())
+                .collect(
+                        Collectors.toMap(
+                                org.apache.flink.table.api.Schema.UnresolvedColumn::getName,

Review Comment:
   good catch



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org