Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Spark: Add basic row lineage test.
  • Loading branch information
rdblue committed Apr 18, 2025
commit a18b51f2966a1df84084a475a2a056d9eb1d783b
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ private boolean useCometBatchReads() {
}

private boolean supportsCometBatchReads(Types.NestedField field) {
return field.type().isPrimitiveType() && !field.type().typeId().equals(Type.TypeID.UUID);
return field.type().isPrimitiveType()
&& !field.type().typeId().equals(Type.TypeID.UUID)
&& field.fieldId() != MetadataColumns.ROW_ID.fieldId()
&& field.fieldId() != MetadataColumns.LAST_UPDATED_SEQUENCE_NUMBER.fieldId();
}

// conditions for using ORC batch reads:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ protected void assertEquals(
Object[] expected = expectedRows.get(row);
Object[] actual = actualRows.get(row);
assertThat(actual).as("Number of columns should match").hasSameSizeAs(expected);
for (int col = 0; col < actualRows.get(row).length; col += 1) {
String newContext = String.format("%s: row %d col %d", context, row + 1, col + 1);
assertEquals(newContext, expected, actual);
}
assertEquals(context + ": row " + (row + 1), expected, actual);
}
}

Expand All @@ -83,7 +80,9 @@ protected void assertEquals(String context, Object[] expectedRow, Object[] actua
assertEquals(newContext, (Object[]) expectedValue, (Object[]) actualValue);
}
} else if (expectedValue != ANY) {
assertThat(actualValue).as(context + " contents should match").isEqualTo(expectedValue);
assertThat(actualValue)
.as(context + " col " + (col + 1) + " contents should match")
.isEqualTo(expectedValue);
}
}
}
Expand Down