-
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
Drop table semantics #1203
Comments
Just to give a bit more context: while doing |
As you mentioned, in delta we can delete tables by simply removing all files from the log, but this will not allow for the create scenario you mentioned. I guess listing and deleting the files is the way to go here... this can be made quite efficient once we get to implementing the batch delete apis offered by the major object stores. Having a special flag to ignore existing data could work, but there i would be quite hesitant, as it would be special to delta-rs, and not honored by other writers etc.. |
This would be good for cleaning up tables. But we should be clear that using |
Nice, looking forward to this!
Makes sense, thanks. For the record I'll circumvent this problem by changing the intended storage layout. Instead of the table uri being dependent on database/schema/table names, it'll be dependent solely on a uuid uniquely tied to that table. This solution may not be general enough for other people, because it relies on us keeping a separate metadata store (e.g. SQLite) to track all the table uuids (in our case, we need one anyway to track the databases/schemas/functions etc.). However, this guarantees that e.g. renaming a table is just a minor op, or that dropping a schema/table can be done lazily (since subsequent re-use of the schema/table names will result in a different uuid, so there won't be conflicts). I also intend on GC-ing the dropped (stale) schema/table directories via some variant of the Therefore this is no longer a (major) issue for me, AFAIC you can close it. I am still very much blocked by #1188 though. |
Description
Use Case
Something high-ish level that allows Rust lib users to erase the root table directory completely, perhaps a
DropTableBuilder
/action/DeltaOperation
/drop
method onDeltaTable
. So effectively an interface that can be used to executeDROP TABLE my_table
SQL.Alternatively, do a lazy drop by delaying physically deleting anything and instead flag the table somehow, so that
CreateTableBuilder
doesn't throwCreateError::TableAlreadyExists
even inSaveMode::ErrorIfExists
mode.Related Issue(s)
Perhaps worthy of including in #1128
The text was updated successfully, but these errors were encountered: