The td table:partial_delete
command enables you to delete your imported data within a specific table by specifying the time range.
We generally recommend using the more flexible Presto DELETE query statement instead of partial-delete.
Requirements
Basic knowledge of Treasure Data, including the TD Toolbelt.
The partial_delete procedure can only delete data from Archive storage and won't alter Realtime storage data.
Data imported Is stored at least 1 hour before or earlier than when you want to delete it in columnar compressed format and partitioned by hour in Archive storage 1 hour before or less in a raw msgpack compressed format and is not partitioned by hour in Realtime storage
Partial Delete Syntax
The arguments for --from
and --to
must be an integer multiple of 3600 (1 hour).
$ td table:partial_delete <db> <table>
example:
$ td table:partial_delete example_db table1 --from 1341000000 --to 1341003600
The data deletion is executed as a job
. You can confirm deletion status by issuing the td jobs
command (see Job Management). The -w
option allows you to wait until the job is finished.