amogh-jahagirdar commented on code in PR #12736:
URL: https://github.com/apache/iceberg/pull/12736#discussion_r2060895675


##########
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:
   I think using TypeUtil.join as it is today is right. My mental model is the 
row lineage fields are a separate schema themselves that we combine with normal 
schemas when we need to. 
   
   Alternatively we could have an API that joins vararg fields? 
(`join(Types.NestedField... fields)`) that would avoid clients creating the 
schema 



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