This chapter introduces how to update data in batch mode in Hippo for Standalone mode only. With batch update, users can perform update operations on target data per specified filter conditions synchronously or asynchronously.
curl -u shiva:shiva -XPOST 'localhost:8902/hippo/v1/_standalone_update_by_query?pretty' -H 'Content-Type: application/json' -d'{
"database_name" : "default",
"table_name" : "table",
"fields": [
{
"field_name": "word_count",
"field_value" : "0"
}
],
"expr" : "word_count > 9000",
"wait_for_completion" : true,
"timeout" : "2m"
}';
Result:
{
"job_type" : "update_by_query",
"table" : "default#table",
"success_number" : 91
}
Parameter description:
Parameters | Description | Required |
---|---|---|
database_name | Database where the destination table is located | No, defaults to "default" database |
table_name | Destination table name | Yes |
expr | Filter condition | No, defaults to full table scan |
fields | Field to be updated | Yes |
field_name (fields) | Name of field to be updated | Yes |
field_value (fields) | Value of field to be updated | No, null if the cell is blank |
wait_for_completion | Whether to wait until the job is done | No, defaults to true |
timeout | Operation timeout | No, defaults to 5 mins |
Table 29 Batch Update -- Standalone Mode (Restful API)