-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add Iceberg support for ALTER TABLE ... SET PROPERTIES #12161
Conversation
case FORMAT_VERSION_PROPERTY: | ||
updateProperty(updateProperties, FORMAT_VERSION, propertyValue, formatVersion -> Integer.toString((int) formatVersion)); | ||
break; | ||
case PARTITIONING_PROPERTY: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should allow changing partitioning, let's have a TODO+issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java
Show resolved
Hide resolved
Add a product test to the class |
plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java
Show resolved
Hide resolved
ccb954b
to
5c98951
Compare
I was thinking about that, but wasn't sure what exactly was testable from the Spark side. The test I added to |
f16fd6e
to
30059ee
Compare
AC Thanks @findepi @findinpath Also added documentation |
@@ -238,6 +238,25 @@ otherwise the procedure will fail with similar message: | |||
``Retention specified (1.00d) is shorter than the minimum retention configured in the system (7.00d)``. | |||
The default value for this property is ``7d``. | |||
|
|||
.. _iceberg-alter-table-set-properties: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mosabua mind taking a look at the doc update?
30059ee
to
d1d1eca
Compare
plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergV2.java
Show resolved
Hide resolved
plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java
Show resolved
Hide resolved
d1d1eca
to
246adbb
Compare
Thanks @findinpath, added those test cases |
246adbb
to
56bb7f5
Compare
The connector supports modifying the properties on existing tables using | ||
:ref:`ALTER TABLE SET PROPERTIES <alter-table-set-properties>`. | ||
|
||
The following table properties can be updated after a table is created: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SELECT * FROM system.metadata.table_properties where catalog_name = 'iceberg';
Do we / should we have documented somewhere this statement used to retrieve the "updatable" table properties?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a separate doc page for system tables or information_schema? I couldn't find one, but I feel like that's where it should go
assertUpdate("CREATE TABLE " + tableName + " WITH (format_version = 1) AS SELECT * FROM tpch.tiny.nation", 25); | ||
assertEquals(loadTable(tableName).operations().current().formatVersion(), 1); | ||
assertUpdate("ALTER TABLE " + tableName + " SET PROPERTIES format_version = 2"); | ||
assertEquals(loadTable(tableName).operations().current().formatVersion(), 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please verify via
assertQuery("SELECT * FROM " + tableName, "SELECT * FROM nation");
that the change of the format_version
has no negative outcome for the end user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
And no, I don't think it does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just thinking that it would be good to have it in case of eventual regressions.
The two properties which can be set are `format` and `format_version`.
56bb7f5
to
4bc37bb
Compare
Description
The two properties which can be set are
format
andformat_version
.New feature
Iceberg connector
Allows updating specific metadata for an Iceberg table. The format_version, and the format of the underlying data files.
Related issues, pull requests, and links
Fixes: #12138
Documentation
( ) No documentation is needed.
(x) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
(x) Release notes entries required with the following suggested text: