Skip to content

Commit

Permalink
[Hotfix] Set table properties in GenericTaskWriters (#3442)
Browse files Browse the repository at this point in the history
* set table properties in GenericTaskWriters

* update stats
  • Loading branch information
XBaith authored Feb 25, 2025
1 parent 7c43e75 commit b81d3e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public GenericBaseTaskWriter buildBaseWriter() {
- 1;
return new GenericBaseTaskWriter(
fileFormat,
new GenericAppenderFactory(base.schema(), table.spec()),
new GenericAppenderFactory(base.schema(), table.spec()).setAll(table.properties()),
new CommonOutputFileFactory(
base.location(),
table.spec(),
Expand Down Expand Up @@ -161,7 +161,7 @@ public SortedPosDeleteWriter<Record> buildBasePosDeleteWriter(
TableProperties.BASE_FILE_FORMAT, TableProperties.BASE_FILE_FORMAT_DEFAULT)
.toUpperCase(Locale.ENGLISH)));
GenericAppenderFactory appenderFactory =
new GenericAppenderFactory(base.schema(), table.spec());
new GenericAppenderFactory(base.schema(), table.spec()).setAll(table.properties());
appenderFactory.set(
org.apache.iceberg.TableProperties.METRICS_MODE_COLUMN_CONF_PREFIX
+ MetadataColumns.DELETE_FILE_PATH.name(),
Expand Down Expand Up @@ -219,7 +219,7 @@ public GenericChangeTaskWriter buildChangeWriter() {
Schema changeWriteSchema = SchemaUtil.changeWriteSchema(change.schema());
return new GenericChangeTaskWriter(
fileFormat,
new GenericAppenderFactory(changeWriteSchema, table.spec()),
new GenericAppenderFactory(changeWriteSchema, table.spec()).setAll(table.properties()),
new CommonOutputFileFactory(
change.location(),
table.spec(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void testStats() {
.matches(
"VALUES "
+ "('id', NULL, NULL, 0e0, NULL, '1', '4'), "
+ "('name$name', 548e0, NULL, 0e0, NULL, NULL, NULL), "
+ "('name$name', 429e0, NULL, 0e0, NULL, NULL, NULL), "
+ "('op_time', NULL, NULL, 0e0, NULL, '2022-01-01 12:00:00.000000', '2022-01-04 12:00:00.000000'), "
+ "(NULL, NULL, NULL, NULL, 4e0, NULL, NULL)");
}
Expand Down

0 comments on commit b81d3e1

Please sign in to comment.