DeleteRow

Last Updated: Oct 11, 2016

DeleteRow

Action:

Deletes one row of data.

Request Message Structure:

  1. message DeleteRowRequest {
  2. required string table_name = 1;
  3. required Condition condition = 2;
  4. repeated Column primary_key = 3;
  5. }

table_name:

  • Type: string

  • Required Parameter: Yes

  • The name of the table to update.

condition:

  • Type: Condition

  • Required Parameter: Yes

  • Determines whether or not to perform existence check before updating data. There are two values:

    • IGNORE indicates that the row existence check is not performed.

    • EXPECT_EXIST indicates that the row is expected to exist.

  • If this row is expected to exist but does not, the delete operation will fail and return an error. If the existence of the row is ignored, whether or not the row exists will not cause this operation to fail.

primary_key:

  • Type: repeated Column

  • Required Parameter: Yes

  • All primary key columns for the row to be updated.

Response Message Structure:

  1. message DeleteRowResponse {
  2. required ConsumedCapacity consumed = 1;
  3. }

consumed:

Capacity Unit Consumption:

  • If the row does not exist, 1 write capacity unit is consumed.

  • If this row does exist, the number of consumed write capacity units is the size of all original data divided by 1KB and rounded up. For information on data size calculation, please refer to Billing Explanation.

  • If an internal error code is returned (HTTP status code: 5XX), this operation will not consume capacity units. If other errors are returned, it will consume 1 write capacity unit.

  • If request timeout occurs and the results are undefined, a capacity unit may or may not be consumed.

Request Example:

  1. DeleteRowRequest {
  2. table_name: "consume_history"
  3. condition {
  4. row_existence: IGNORE
  5. }
  6. primary_key {
  7. name: "CardID"
  8. value {
  9. type: STRING
  10. v_string: "2007035023"
  11. }
  12. }
  13. primary_key {
  14. name: "SellerID"
  15. value {
  16. type: STRING
  17. v_string: "00022"
  18. }
  19. }
  20. primary_key {
  21. name: "DeviceID"
  22. value {
  23. type: STRING
  24. v_string: "061104"
  25. }
  26. }
  27. primary_key {
  28. name: "OrderNumber"
  29. value {
  30. type: INTEGER
  31. v_int: 142857
  32. }
  33. }
  34. }

Response Example:

  1. DeleteRowResponse {
  2. consumed {
  3. capacity_unit {
  4. write: 1
  5. }
  6. }
  7. }
Thank you! We've received your feedback.