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


##########
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:
   The update looks good. We may want to have a few different forms, like 
`join(Schema, NestedField...)` but this is much simpler now that the `Table` 
has been removed. Thanks!



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