Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hotfix] Set table properties in GenericTaskWriters #3442

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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), "
Copy link
Contributor Author

@XBaith XBaith Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a estimated value and used by query optimize and cost estimation. So I think the change is not a issue

+ "('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