yihua commented on code in PR #20883:
URL: https://github.com/apache/hudi/pull/20883#discussion_r4724548059
##########
hudi-common/src/test/java/org/apache/hudi/tableformat/TestTableFormat.java:
##########
@@ -113,4 +205,99 @@ public TimelineFactory getTimelineFactory() {
public TableMetadataFactory getMetadataFactory() {
return TestTableMetadataFactory.getInstance();
}
+
+ private static HoodieSchemaField nullableLongField(String name) {
+ return HoodieSchemaField.of(name,
HoodieSchema.createNullable(HoodieSchemaType.LONG), null,
HoodieSchema.NULL_VALUE);
+ }
+
+ /**
+ * A row lineage column: null for a new or updated row, and for a row
carried over unchanged, the value its base
+ * file stores, or the one derived from the row lineage values assigned to
the base file.
+ */
+ private static class RowLineageColumn implements FormatMetaColumn {
+ private final String name;
+ private final boolean rowId;
+
+ private RowLineageColumn(String name, boolean rowId) {
+ this.name = name;
+ this.rowId = rowId;
+ }
+
+ @Override
+ public HoodieSchemaField field() {
+ return nullableLongField(name);
+ }
+
+ @Override
+ public Object valueOnWrite(String instantTime) {
Review Comment:
Done, the row ID column now returns `replacedValue` (the sequence number
stays null), and the Java and Spark row-lineage tests pin that an updated row
keeps its row ID and gets the new file's sequence number.
--
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]