Skip to content

feat: add update table properties support - #363

Merged
wgtmac merged 2 commits into
apache:mainfrom
WZhuo:update_properties
Dec 3, 2025
Merged

feat: add update table properties support#363
wgtmac merged 2 commits into
apache:mainfrom
WZhuo:update_properties

Conversation

@WZhuo

@WZhuo WZhuo commented Nov 28, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@WZhuo
WZhuo force-pushed the update_properties branch 23 times, most recently from 5f98124 to 387401a Compare December 2, 2025 03:04
Comment thread src/iceberg/metrics_config.cc Outdated
Comment thread src/iceberg/test/CMakeLists.txt Outdated
Comment thread src/iceberg/update/update_properties.h
Comment thread src/iceberg/update/update_properties.h Outdated
Comment thread src/iceberg/update/update_properties.h Outdated
Comment thread src/iceberg/update/update_properties.cc
Comment thread src/iceberg/update/update_properties.cc Outdated
Comment thread src/iceberg/update/update_properties.cc Outdated
Comment thread src/iceberg/metrics_config.cc
Comment thread src/iceberg/metrics_config.cc
Comment thread src/iceberg/table_properties.h Outdated
Comment thread src/iceberg/table.h
Comment thread src/iceberg/table.cc
Comment thread src/iceberg/update/update_properties.h Outdated
Comment thread src/iceberg/update/update_properties.h Outdated
Comment thread src/iceberg/update/update_properties.h
@WZhuo
WZhuo force-pushed the update_properties branch 5 times, most recently from 11604e3 to ce0b6ea Compare December 2, 2025 12:28
@WZhuo
WZhuo force-pushed the update_properties branch from ce0b6ea to d50ffd6 Compare December 3, 2025 02:02

@wgtmac wgtmac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good now. I just left some minor comments.

Comment thread src/iceberg/metrics_config.cc
Comment thread src/iceberg/test/metrics_config_test.cc Outdated
"counts";

auto result = MetricsConfig::VerifyReferencedColumns(updates, *schema_);
EXPECT_FALSE(result.has_value())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: you can #include "iceberg/test/matchers.h" and then write

EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed));
EXPECT_THAT(result, HasErrorMessage("..."));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Replace all EXPECT_xxx(result.has_value()) with EXPECT_THAT(result, IsError/IsOk);

Comment thread src/iceberg/test/update_properties_test.cc Outdated
Comment thread src/iceberg/test/update_properties_test.cc
Comment thread src/iceberg/update/update_properties.h Outdated
Comment on lines +43 to +44
UpdateProperties(TableIdentifier identifier, std::shared_ptr<Catalog> catalog,
std::shared_ptr<TableMetadata> metadata);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sounds good. I still suggest renaming metadata to base to make it explicit.

Do we need to check if catalog or base is null? We cannot throw in the ctor, perhaps we should check them in Apply and Commit.

Comment thread src/iceberg/update/update_properties.h Outdated
///
/// \param format The file format type to use as default
/// \return Reference to this UpdateProperties for chaining
UpdateProperties& DefaultFormat(FileFormatType format);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes I understand. I still think we don't need special case the file format config to make the API simple. The Java impl seems have some historical reasons and we don't need to follow everything.

Comment thread src/iceberg/update/update_properties.cc Outdated
Comment thread src/iceberg/update/update_properties.cc Outdated
Comment thread src/iceberg/update/update_properties.cc Outdated
@WZhuo
WZhuo force-pushed the update_properties branch from d50ffd6 to 2b308fb Compare December 3, 2025 03:30
@WZhuo
WZhuo force-pushed the update_properties branch from 2b308fb to 04505a4 Compare December 3, 2025 03:37
Comment thread src/iceberg/test/update_properties_test.cc Outdated

@wgtmac wgtmac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for working on this! LGTM

@wgtmac wgtmac changed the title feat: update table properties api feat: add update table properties support Dec 3, 2025
@wgtmac
wgtmac merged commit c472f3c into apache:main Dec 3, 2025
10 checks passed
@WZhuo
WZhuo deleted the update_properties branch January 8, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants