Added ability to have unique table location for each iceberg table#6063
Added ability to have unique table location for each iceberg table#6063findepi merged 1 commit intotrinodb:masterfrom
Conversation
electrum
left a comment
There was a problem hiding this comment.
A few minor comments, otherwise looks good
presto-iceberg/src/main/java/io/prestosql/plugin/iceberg/IcebergConfig.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/io/prestosql/plugin/iceberg/IcebergConfig.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/io/prestosql/plugin/iceberg/IcebergMetadata.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/io/prestosql/plugin/iceberg/IcebergMetadataFactory.java
Outdated
Show resolved
Hide resolved
@electrum Thanks for the comments, I have performed code fixes for all of them |
|
@electrum is it possible to have this changes in the next release? |
|
@electrum could you please approve this PR in case of all looks good? |
|
@electrum I would be really appreciate for your review of this PR |
raunaqmorarka
left a comment
There was a problem hiding this comment.
Please add test to AbstractTestIcebergSmoke to verify that some UUID as added to table location.
Does iceberg.unique-table-location have any purpose beyond making it possible for Trino to delete data on drop of table ?
If not, it would be easier to have just one flag iceberg.delete-files-on-table-drop and implement both unique table location and data removal behind that flag rather than requiring users to set 2 flags.
Should we also be providing this as a table property ? From user point of view it's easier to create a "managed" table using table property rather than changing config to set a catalog property.
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/IcebergConfig.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergConfig.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java
Outdated
Show resolved
Hide resolved
findepi
left a comment
There was a problem hiding this comment.
Thanks for adding the test.
Overall LGTM. Some editorial comments in the test.
.../trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergTableWithCustomLocation.java
Outdated
Show resolved
Hide resolved
.../trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergTableWithCustomLocation.java
Outdated
Show resolved
Hide resolved
.../trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergTableWithCustomLocation.java
Outdated
Show resolved
Hide resolved
.../trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergTableWithCustomLocation.java
Outdated
Show resolved
Hide resolved
.../trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergTableWithCustomLocation.java
Outdated
Show resolved
Hide resolved
|
cc @rdblue |
There was a problem hiding this comment.
Please update formatting
- all parameters on one line OR each parameter on its own line (including the first one)
- for indentation please refer to https://github.com/airlift/codestyle/
There was a problem hiding this comment.
Thanks for the link to code style.
Formatting updated
There was a problem hiding this comment.
We call it connectorProperties in other XxxQueryRunner classes.
also, no need for optional, since empty map has the same meaning
Map<String, String> connectorProperties)
also, please add it right after extraProperties (also seems usual)
There was a problem hiding this comment.
Why two levels of nesting?
Would it be fine to have just
metastoreDir = Files.createTempDirectory("....");
?
There was a problem hiding this comment.
however, it seems the test doesn't need to know the metastoreDir, so instead of setting it up (and cleaning it later), it should be sufficient to pass Optional.empty() for the metastoreDir, right?
There was a problem hiding this comment.
we need metastoreDir because it is used in createTestingFileHiveMetastore(metastoreDir),
but I removed two levels nesting
There was a problem hiding this comment.
use default
new IcebergConfig().getFileFormat()
There was a problem hiding this comment.
as a follow up we should remove format parameter and use the new connectorProperties instead
There was a problem hiding this comment.
replaced with new IcebergConfig().getFileFormat()
There was a problem hiding this comment.
Do not use assertTrue with complex expressions. In case of failure, it produces unhelpful message.
Use
[org.assertj.core.api.Assertions.] assertThat(location).matches(....);
instead
|
@sshkvar could you please remove the merge commits from the git history? |
done |
|
@sshkvar thanks! |
|
@findepi I combined changes to single commit |
|
Merged, thanks! |
Thanks you for the review! |
#5632
Added new iceberg configuration property
iceberg.unique-table-locationBy default this
property = false, so table directory will have the same name as table.In case
iceberg.unique-table-location = trueunique UUID will be added to the table directory name, so each table will have unique location