Truncate TableΒΆ

TRUNCATE TABLE table_name [PARTITION part_spec]

part_spec:
    : (part_col1=value1, part_col2=value2, ...)

Delete all rows from a table or matching partitions in the table. The table must not be a temporary table, an external table, or a view.

PARTITION
Specify a partial partition spec to match partitions to be truncated. In Spark 2.0, this is only supported for tables created using the Hive format. Since Spark 2.1 release, data source tables are also supported.