Batch Delete

This chapter introduces how to delete data in batches synchronously or asynchronously based on the filter condition.

curl -u shiva:shiva -XPOST 'localhost:8902/hippo/v1/_delete_by_query?pretty' -H 'Content-Type: application/json' -d'{
  "database_name" : "default",
  "table_name" : "book1",
  "expr" : "word_count >= 11000",
  "wait_for_completion" : true,
  "timeout" : "2m"
}';

Result:

{                        
  "job_id" : "166882d19e1e4274a155a0523828ebc0",                
  "job_status" : "SHIVA_JOB_SUCCESS",                  
  "deleted_number" : 90,                         
  "failed_number" : 0,                
  "task_results" : [                    
    {                         
      "id" : "5cf0fa8728e245969071b28e94bc143a",                        
      "status" : "TASK_SUCCESS",
      "server" : "192.168.0.110:27851",                       
      "deleted_number" : 90,         
      "failed_number" : 0,                       
      "execute_time" : 0.004                             
    }          
  ]                                 
}

Parameter description:

ParametersDescriptionRequired
database_nameDatabase where the destination table is locatedNo, defaults to "default" database
table_nameDestination table nameYes
exprFilter condition when scanning data from source tableNo, defaults to full table scan
wait_for_completionWhether to wait until the job is doneNo, defaults to true
timeoutOperation timeoutNo, defaults to 5 mins
Table 21 Batch Delete (Restful API)