rdblue commented on code in PR #12736:
URL: https://github.com/apache/iceberg/pull/12736#discussion_r2060856557


##########
core/src/main/java/org/apache/iceberg/MetadataColumns.java:
##########
@@ -152,4 +154,19 @@ public static boolean isMetadataColumn(int id) {
   public static boolean nonMetadataColumn(String name) {
     return !isMetadataColumn(name);
   }
+
+  public static Schema schemaWithRowLineage(Table table) {
+    Preconditions.checkArgument(null != table, "Invalid table: null");
+    Preconditions.checkArgument(
+        !(table instanceof BaseMetadataTable),
+        "Cannot produce row lineage for metadata table: %s",
+        table);
+    Schema rowLineageSchema =
+        new Schema(
+            MetadataColumns.metadataColumn(table, 
MetadataColumns.ROW_ID.name()).asOptional(),
+            MetadataColumns.metadataColumn(
+                    table, MetadataColumns.LAST_UPDATED_SEQUENCE_NUMBER.name())
+                .asOptional());
+    return TypeUtil.join(table.schema(), rowLineageSchema);

Review Comment:
   Looks like this is constructing `Schema` instances just to satisfy the types 
expected by `TypeUtil.join`. Is there an alternative method? Should there be?



-- 
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-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to