Truncate Table
The Truncate Table orchestration component removes all rows from a table or partitions, while keeping the table intact. The table must not be a view or an external or temporary table.
Truncate is implemented in two different ways, depending on whether the current flow is in the middle of a database transaction or not. The first is by using a TRUNCATE
statement. For more information, read TRUNCATE TABLE for Snowflake, TRUNCATE TABLE for Databricks, and TRUNCATE for Redshift, respectively. The second is by using a DELETE FROM
statement, which is preferable if the current pipeline is using a transaction. For more information, read DELETE FROM for Snowflake, DELETE FROM for Databricks, and DELETE for Redshift, respectively.
- A truncate operation is faster than a delete operation.
- A truncate operation is not transaction safe—it cannot be rolled back.
Properties
Name
= string
A human-readable name for the component.
Warehouse
= drop-down
The Snowflake warehouse used to run the queries. The special value, [Environment Default], will use the warehouse defined in the environment. Read Overview of Warehouses to learn more.
Database
= drop-down
The Snowflake database. The special value, [Environment Default], will use the database defined in the environment. Read Databases, Tables and Views - Overview to learn more.
Schema
= drop-down
The Snowflake schema. The special value, [Environment Default], will use the schema defined in the environment. Read Database, Schema, and Share DDL to learn more.
Target Table
= dual-listbox
The tables you want to truncate.
To use grid variables, tick the Use Grid Variable checkbox at the bottom of the Target Table dialog.
Name
= string
A human-readable name for the component.
Catalog
= drop-down
Select a Databricks Unity Catalog. The special value, [Environment Default], will use the catalog specified in the Data Productivity Cloud environment setup. Selecting a catalog will determine which databases are available in the next parameter.
Database
= drop-down
Select the Delta Lake database. The special value, [Environment Default], will use the database specified in the Data Productivity Cloud environment setup.
Tables to Truncate
= dual listbox
Select the tables you want to truncate.
To use grid variables, tick the Use Grid Variable checkbox at the bottom of the Tables to Truncate dialog.
Name
= string
A human-readable name for the component.
Schema
= drop-down
Select the Amazon Redshift schema. The special value, [Environment Default], will use the schema defined in the environment. Read Schemas, to learn more.
Tables to Truncate
= dual listbox
Select the tables you want to truncate.
To use grid variables, tick the Use Grid Variable checkbox at the bottom of the Tables to Truncate dialog.
Snowflake | Databricks | Amazon Redshift |
---|---|---|
✅ | ✅ | ✅ |