-
Notifications
You must be signed in to change notification settings - Fork 406
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
[Improvement] Clarify the definitions and behaviors of interfaces dropTable
and purgeTable
#1436
Comments
@jerryshao @yuqi1129 @diqiu50 @FANNG1 @Clearvive @qqqttt123 Do you have any suggestions on this? |
LGTM, let's check it separately. |
Iceberg has different meanings, dropTable is drop metadata while purge table is drop metadata and data. |
Can you provide some reference for that? @FANNG1 |
After that, should the DROP TABLE statement in Trino call the drop table API instead of using purgeTable? |
see https://iceberg.apache.org/docs/latest/spark-ddl/#drop-table-purge and dropTable in /**
* Drop a table; optionally delete data and metadata files.
*
* <p>If purge is set to true the implementation should delete all data and metadata files.
*
* @param identifier a table identifier
* @param purge if true, delete all data and metadata files in the table
* @return true if the table was dropped, false if the table did not exist
*/
boolean dropTable(TableIdentifier identifier, boolean purge); |
I don't think they have different meaning. Iceberg is based on object storage. Object storage may not have their own trash mechnism. Maybe we can treat the snapshot of Iceberg as a trash. So |
I think in most scenarios it is, depending on the semantics of Trino's |
yes, agree. |
…imon instead of dropTable inGravitino (#4806) ### What changes were proposed in this pull request? the dropTable in Paimon will both delete the metadata and data and skip the trash, as discussed in #1436 , Gravitino Paimon catalog should use purgeTable not dropTable ### Why are the changes needed? #4814 ### Does this PR introduce any user-facing change? yes, updated the doc. ### How was this patch tested? existing ITs and UTs.
…imon instead of dropTable inGravitino (#4806) ### What changes were proposed in this pull request? the dropTable in Paimon will both delete the metadata and data and skip the trash, as discussed in #1436 , Gravitino Paimon catalog should use purgeTable not dropTable ### Why are the changes needed? #4814 ### Does this PR introduce any user-facing change? yes, updated the doc. ### How was this patch tested? existing ITs and UTs.
…imon instead of dropTable inGravitino (#4820) ### What changes were proposed in this pull request? the dropTable in Paimon will both delete the metadata and data and skip the trash, as discussed in #1436 , Gravitino Paimon catalog should use purgeTable not dropTable ### Why are the changes needed? #4814 ### Does this PR introduce any user-facing change? yes, updated the doc. ### How was this patch tested? existing ITs and UTs. Co-authored-by: cai can <[email protected]>
What would you like to be improved?
The described of
dropTable
is:and the
purgeTable
is:However, the original intention behind designing these two interfaces was that:
dropTable
should delete the metadata and data of the table simultaneously. (If a recycle bin is available, the deleted data should go to the recycle bin.)purgeTable
is intended for catalogs with a recycle bin feature, ensuring that the table data is deleted from the recycle bin afterdropTable
. Otherwise, anUnsupportedOperationException
should be thrown.How should we improve?
Improving the method comment, checking the method call and implementation, and making sure the method's invocation scenario is in line with the semantic meaning of the method.
dropTable
andpurgeTable
#1439dropTable
andpurgeTable
#1441dropTable
andpurgeTable
#1442dropTable
andpurgeTable
#1443The text was updated successfully, but these errors were encountered: