Delete partition stats

ByteHouse Cloud Data Warehouse (CDW) supports both unique table and normal table. Unique table supports deleting a single data record through delete flag, while normal table does not, and can only delete data under a partition. To delete a single data record from a normal table, delete the partition where the data is located and then re-import the data.

Here, we use cell_tower data as an example to introduce two ways of deleting partitions. For the creation of cell_tower table and data import, refer sample query.

Deleting partitions using the console

After importing the cell_tower data, you can view the corresponding database table (the metadata may have a refreshing delay of 5 minutes), and see partition statistics information. This data table uses monthly partitioning based on the first day of each month. You can use filters to search for partition keys with finer granularity .

Select the specific partition key, delete the data in the upper right corner, and choose confirm to delete the corresponding partition.

Deleting partitions using SQL

You can execute the following SQL to delete partitions:

ALTER TABLE `cell_towers` 
DROP PARTITION '2009-08-01',
DROP PARTITION '2009-07-01';