Skip to content

Commit

Permalink
Rename variable equalityFieldIds to identifierFieldIds
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsimsek committed Sep 8, 2024
1 parent 8269d89 commit e3859c9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ abstract class BaseDeltaTaskWriter extends BaseTaskWriter<Record> {
FileIO io,
long targetFileSize,
Schema schema,
Set<Integer> equalityFieldIds,
Set<Integer> identifierFieldIds,
boolean upsert,
boolean upsertKeepDeletes) {
super(spec, format, appenderFactory, fileFactory, io, targetFileSize);
this.schema = schema;
this.deleteSchema = TypeUtil.select(schema, Sets.newHashSet(equalityFieldIds));
this.deleteSchema = TypeUtil.select(schema, Sets.newHashSet(identifierFieldIds));
this.wrapper = new InternalRecordWrapper(schema.asStruct());
this.keyWrapper = new InternalRecordWrapper(deleteSchema.asStruct());
this.keyProjection = RecordProjection.create(schema, deleteSchema);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public BaseTaskWriter<Record> create(Table icebergTable) {
GenericAppenderFactory appenderFactory = IcebergUtil.getTableAppender(icebergTable);
OutputFileFactory fileFactory = IcebergUtil.getTableOutputFileFactory(icebergTable, format);
// equality Field Ids
Set<Integer> equalityFieldIds = icebergTable.schema().identifierFieldIds();
Set<Integer> identifierFieldIds = icebergTable.schema().identifierFieldIds();
long targetFileSize =
PropertyUtil.propertyAsLong(
icebergTable.properties(), WRITE_TARGET_FILE_SIZE_BYTES, WRITE_TARGET_FILE_SIZE_BYTES_DEFAULT);
Expand Down Expand Up @@ -76,12 +76,12 @@ else if (icebergTable.spec().isUnpartitioned()) {
// running with upsert mode + un partitioned table
writer = new UnpartitionedDeltaWriter(icebergTable.spec(), format, appenderFactory, fileFactory,
icebergTable.io(),
targetFileSize, icebergTable.schema(), equalityFieldIds, true, upsertKeepDeletes);
targetFileSize, icebergTable.schema(), identifierFieldIds, true, upsertKeepDeletes);
} else {
// running with upsert mode + partitioned table
writer = new PartitionedDeltaWriter(icebergTable.spec(), format, appenderFactory, fileFactory,
icebergTable.io(),
targetFileSize, icebergTable.schema(), equalityFieldIds, true, upsertKeepDeletes);
targetFileSize, icebergTable.schema(), identifierFieldIds, true, upsertKeepDeletes);
}

return writer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class PartitionedDeltaWriter extends BaseDeltaTaskWriter {
FileIO io,
long targetFileSize,
Schema schema,
Set<Integer> equalityFieldIds,
Set<Integer> identifierFieldIds,
boolean upsert,
boolean upsertKeepDeletes) {
super(spec, format, appenderFactory, fileFactory, io, targetFileSize, schema, equalityFieldIds, upsert, upsertKeepDeletes);
super(spec, format, appenderFactory, fileFactory, io, targetFileSize, schema, identifierFieldIds, upsert, upsertKeepDeletes);
this.partitionKey = new PartitionKey(spec, schema);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class UnpartitionedDeltaWriter extends BaseDeltaTaskWriter {
FileIO io,
long targetFileSize,
Schema schema,
Set<Integer> equalityFieldIds,
Set<Integer> identifierFieldIds,
boolean upsert,
boolean upsertKeepDeletes) {
super(spec, format, appenderFactory, fileFactory, io, targetFileSize, schema, equalityFieldIds, upsert, upsertKeepDeletes);
super(spec, format, appenderFactory, fileFactory, io, targetFileSize, schema, identifierFieldIds, upsert, upsertKeepDeletes);
this.writer = new RowDataDeltaWriter(null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class BaseWriterTest {
FileFormat format;
GenericAppenderFactory appenderFactory;
OutputFileFactory fileFactory;
Set<Integer> equalityFieldIds;
Set<Integer> identifierFieldIds;

protected static final Schema SCHEMA =
new Schema(
Expand Down Expand Up @@ -55,7 +55,7 @@ public void before() {
format = IcebergUtil.getTableFileFormat(table);
appenderFactory = IcebergUtil.getTableAppender(table);
fileFactory = IcebergUtil.getTableOutputFileFactory(table, format);
equalityFieldIds = table.schema().identifierFieldIds();
identifierFieldIds = table.schema().identifierFieldIds();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class UnpartitionedDeltaWriterTest extends BaseWriterTest {
public void testUnpartitionedDeltaWriter() throws IOException {
UnpartitionedDeltaWriter writer = new UnpartitionedDeltaWriter(table.spec(), format, appenderFactory, fileFactory,
table.io(),
Long.MAX_VALUE, table.schema(), equalityFieldIds, true, true);
Long.MAX_VALUE, table.schema(), identifierFieldIds, true, true);

Record row = GenericRecord.create(SCHEMA);
row.setField("id", "123");
Expand Down

0 comments on commit e3859c9

Please sign in to comment.