dimas-b commented on code in PR #4048:
URL: https://github.com/apache/polaris/pull/4048#discussion_r2982585848


##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java:
##########
@@ -684,6 +684,25 @@ public void reportMetrics(TableIdentifier identifier, 
ReportMetricsRequest reque
     return null; // could be an external catalog
   }
 
+  /**
+   * Extract labels from a table entity's internal properties. Properties with 
the "label." prefix
+   * are catalog-scoped metadata (not part of Iceberg table state) and are 
surfaced as labels in the
+   * LoadTableResponse.
+   */
+  public Map<String, String> getLabelsForTable(TableIdentifier 
tableIdentifier) {
+    IcebergTableLikeEntity entity = getTableEntity(tableIdentifier);
+    if (entity == null) {
+      return Map.of();
+    }
+    Map<String, String> labels = new java.util.HashMap<>();
+    entity.getInternalPropertiesAsMap().forEach((key, value) -> {
+      if (key.startsWith("label.")) {

Review Comment:
   I do not think internal properties were meant to be exposed to clients at 
all, but using a prefix to filter them might be ok. This probably deserves a 
discussion on the Polaris `dev` ML.



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