laskoviymishka commented on code in PR #4048:
URL: https://github.com/apache/polaris/pull/4048#discussion_r2984436691


##########
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:
   that's a POC, i think if this would be accepted at IRC Spec we may find a 
better way, but using a special prefix may be an acceptable solution too.



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