Skip to main content

TRUNCATE

Delete all rows from a table with minimal computation by restating the table with no data files.

note:

This command is not supported on Amazon Glue datasources.

Syntax
TRUNCATE [ TABLE ] [ IF EXISTS ] <table_name>

Parameters

{{< sql-section file="data/sql/apache-iceberg-tables.json" data="truncatingData" >}}

Examples

Truncate a table
TRUNCATE myTable
Truncate a table using supporting clauses
TRUNCATE TABLE IF EXISTS myTable