Skip to content
Last updated

Partial Deletion Syntax

2025/02: Partial_Delete is deprecated We recommend using the more flexible Presto DELETE query statement instead of partial-delete.

The td table:partial_delete command enables you to delete your imported data within a specific table by specifying the time range.

Requirements

  • Basic knowledge of Treasure Data, including the TD Toolbelt.

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.

Recommend

Use td command instead;

$ td query -d example_db -w "DELETE table1 WHERE TD_TIME_RANGE(time, '2016-01-01', 2016-02-01')"