Respect hive.metastore.thrift.delete-files-on-drop config property for dropping partitions#13822
Conversation
plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftHiveMetastore.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftHiveMetastore.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftHiveMetastore.java
Outdated
Show resolved
Hide resolved
|
The Hive connector doc needs an update if we're going to do this. Specifically: |
|
I don't think we need to update |
f7ff00b to
577addc
Compare
There was a problem hiding this comment.
Using normal test environment because somehow I can't reproduce the issue on product test environment.
577addc to
eceb235
Compare
There was a problem hiding this comment.
Should we wrap the file deletion in a separate try/catch?
I'm just thinking, if the partition is dropped from the metastore but the file system doesn't allow us to delete the files for some reason, the query should still succeed right?
There was a problem hiding this comment.
I feel users should disable it in such cases. This feature can be controlled by config property, so exception looks better in my opinion.
There was a problem hiding this comment.
I think it depends on what the behavior is for a following select statement. If I run a drop partition and it fails, the partition should still show up in the next query. If it doesn't show up, the drop should succeed. Does that make sense?
There was a problem hiding this comment.
I was missing that subsequent deleteDirRecursive already has try-catch block in the method. Do you think it still requires additional change?
There was a problem hiding this comment.
You're totally right. This is fine
|
There are several CI failures. |
Added empty commit to retrigger the build after #14323 merged. |
6af2c70 to
db0758b
Compare
|
CI hit #14441 |
There was a problem hiding this comment.
It's not redundant. ThriftMetastoreConfig.setDeleteFilesOnDrop is equals to hive.metastore.thrift.delete-files-on-drop not hive.allow-register-partition-procedure.
There was a problem hiding this comment.
else validate initialTables is empty, since it's ignored otherwise
however, a better way for this would be to call the parameter createTpchSchemas
then createTpchSchemas(false) would skip schema cretion and initialTables(empty) (default) would skip tables creation
There was a problem hiding this comment.
Renamed to createTpchSchemas .
There was a problem hiding this comment.
are we using s3.*.amazonaws.com without https://? should we add it explicitly? in secrets?
There was a problem hiding this comment.
Pushed another commit to add the prefix.
There was a problem hiding this comment.
Maybe it would make sense to check that the table in fact is empty?
There was a problem hiding this comment.
Included additional assertions.
db0758b to
3407144
Compare
|
Addressed comments. |
|
LGTM, but the build is red |
|
Failed jobs succeeded in #14557 (within the repo). I will take a look these failures and file issues if needed. |
|
@ebyhr Is there a similar property available for glue metastore. Upon drop table command, the table meta information is deleted from glue but the underlying data remains in azure. Anything you can suggest to allow dropping of data? |
Description
Respect
hive.metastore.thrift.delete-files-on-dropconfig property for dropping partitionsFixes #13545 Fixes #13821
Documentation
(x) Sufficient documentation is included in this PR.
Release notes
(x) Release notes entries required with the following suggested text: