Data Operation - Drop
About
drop is a intermediate operation that will drop the inputs. It will remove:
- their metadata
- and their data (content).
As there is no way to retrieve the data or metadata, you should use this operation with care.
System Equivalence
- A drop operation on a file is equivalent to a remove or delete.
- A drop operation on a sql table is equivalent to a drop table.
Arguments
| Name | Default | Description |
|---|---|---|
| force | false | Drop the foreign keys for a table |
| cascade | false | Drop recursively the dependent resources |
| processing-type | batch | The processing type In stream processing, inputs are dropped one at a time In batch processing, they are dropped in batch |
processing-type
By default, the processing type is batch because it can handle a bad sql view.
When ordering the resources in a drop order, an error may occur if a sql view has a non-valid SQL Statement:
- the view is not valid anymore
- we can't get its dependencies.
batch processing will ignore it and try to drop the inputs in received order.
Cli
The drop operation is available in the tabul data drop cli command
Note
How to drop dependent table ?
If you execute drop in:
- batch processing, the drop operation will drop them in drop order automatically.
- stream processing, the select operation should have the order option set to drop so that the tables are send in the pipeline in a drop order.
Otherwise you may see error like:
Cause: ERROR: cannot drop table call_center because other objects depend on it
Detail: constraint catalog_sales_cs_call_center_sk_fkey on table catalog_sales depends on table call_center
constraint catalog_returns_cr_call_center_sk_fkey on table catalog_returns depends on table call_center
Hint: Use DROP ... CASCADE to drop the dependent objects too.