Tablestore provides the following single-row operations: PutRow, GetRow, UpdateRow, and DeleteRow.

Prerequisites

  • The OTSClient instance is initialized. For more information, see Initialization.
  • A data table is created. Data is written to the table.

PutRow

You can call this operation to insert a row. If the row exists, data of all versions in all columns of the row is deleted before new data is inserted.

  • Operations
        /**
         * Write a row of data. If the row exists, data of all versions in all columns of the row is deleted before new data is inserted. The number of the consumed capacity units (CUs) is returned.
          * @api
         * @param [] $request The request parameters.
         * @return [] The response. 
         * @throws OTSClientException The exception that is returned when a parameter error occurs or the Tablestore server returns a verification error.
         * @throws OTSServerException The exception that is returned when the Tablestore server returns an error.
         */
        public function putRow(array $request); 
                
  • Request parameters
    Parameter Description
    table_name The name of the table.
    condition You can use conditional update to set a row existence condition or columns-based conditions for the row. For more information, see Configure conditional update.
    • row_existence: the row existence condition.
      Note
      • RowExistenceExpectationConst::CONST_IGNORE indicates that new data is inserted into a row no matter whether the specified row exists. If the specified row exists, the existing data is overwritten.
      • RowExistenceExpectationConst::CONST_EXPECT_EXIST indicates that new data is inserted only when the specified row exists. The existing data is overwritten.
      • RowExistenceExpectationConst::CONST_EXPECT_NOT_EXIST indicates that data is inserted only when the specified row does not exist.
    • column_condition: the column-based condition.
    primary_key The primary key of the row.
    Note
    • The configured number and types of primary key columns must be consistent with the actual number and types of primary key columns of the table.
    • For an auto-increment primary key column, you need only to set the value of the auto-increment primary key column to a placeholder. For more information, see Configure an auto-increment primary key column.
    • The primary key of a table can contain one to four primary key columns. Primary key columns are sorted in the order in which they are added. For example, the schema of PRIMARY KEY (A, B, C) is different from that of PRIMARY KEY (A, C, B). Tablestore sorts rows based on the values of all primary key columns.
    • Each primary key column is specified by parameters in the following sequence: the primary key name, primary key value (PrimaryKeyValue), and primary key type (PrimaryKeyType). PrimaryKeyType is optional.
    • The value of PrimaryKeyValue can be an integer, a binary, or a string.
    • PrimaryKeyType can be set to PrimaryKeyTypeConst::CONST_INTEGER, PrimaryKeyTypeConst::CONST_STRING, PrimaryKeyTypeConst::CONST_BINARY, or PrimaryKeyTypeConst::CONST_PK_AUTO_INCR (auto-increment primary key columns), which separately indicate the INTEGER, STRING (UTF-8 encoded string), BINARY, and PK_AUTO_INCR (auto-increment primary key columns) types. If the type of data is INTEGER or STRING, this parameter can be ignored. Otherwise, the type must be specified.
    attribute_columns The attribute columns of the row.
    • An attribute column is specified by parameters in the following sequence: the attribute column name, attribute column value (ColumnValue), attribute column value type (ColumnType, which is optional), and timestamp (optional).
    • ColumnType can be set to ColumnTypeConst::CONST_INTEGER, ColumnTypeConst::CONST_STRING, ColumnTypeConst::CONST_BINARY, ColumnTypeConst::CONST_BOOLEAN, or ColumnTypeConst::CONST_DOUBLE, which separately indicate the INTEGER, STRING (UTF-8 encoded string), BINARY, BOOLEAN, and DOUBLE types. If the type of data is BINARY, this parameter must be specified. Otherwise, the type can be ignored or set to null.
    • A timestamp is the data version number. For more information, see Max versions and TTL.

      You can customize a data version number or use the data version number generated by Tablestore. If you do not specify this parameter, the data version number generated by the system is used.

      • The version number generated by Tablestore is calculated based on the number of milliseconds that have elapsed since 00:00:00 UTC on January 1, 1970.
      • When you choose to specify the version number, make sure that the version number is a 64-bit timestamp accurate to the millisecond within the valid version range.
    return_content The return type.

    return_type: Set the value to ReturnTypeConst::CONST_PK, which returns the primary key values. This parameter is used for auto-increment primary key columns.

  • Request format
    $result = $client->putRow([
        'table_name' => '<string>', // Set the table name.
        'condition' => [
            'row_existence' => <RowExistence>,   
            'column_condition' => <ColumnCondition>
        ],
        'primary_key' => [                              // Set the primary key.
            ['<string>', <PrimaryKeyValue>], 
            ['<string>', <PrimaryKeyValue>],
            ['<string>', <PrimaryKeyValue>, <PrimaryKeyType>]
        ],  
        'attribute_columns' => [         // Set the attribute column.
                ['<string>', <ColumnValue>], 
                ['<string>', <ColumnValue>, <ColumnType>],
                ['<string>', <ColumnValue>, <ColumnType>, <integer>]
        ],
        'return_content' => [
            'return_type' => <ReturnType>
        ]
    ]);         
  • Response parameters
    Parameter Description
    consumed The number of CUs consumed by this operation.
    capacity_unit: the number of read and write CUs consumed.
    • read: the read throughput
    • write: the write throughput
    primary_key The value of the primary key, which is consistent with that in the request.
    Note If you set return_type to ReturnTypeConst::CONST_PK, the value of the primary key is returned.
    attribute_columns The values of attribute columns. The attribute column names are consistent with those specified in the request. At present, the value of this paramter is empty.
  • Response format
    [
        'consumed' => [
            'capacity_unit' => [
                'read' => <integer>,
                'write' => <integer>
            ]
        ],
        'primary_key' => [ 
            ['<string>', <PrimaryKeyValue>], 
            ['<string>', <PrimaryKeyValue>],
            ['<string>', <PrimaryKeyValue>, <PrimaryKeyType>]
        ],  
        'attribute_columns' => []
    ]        
  • Example 1

    The following code provides an example on how to write a row that contains 10 attribute columns and write one version of data for each column. The version number (timestamp) is generated by Tablestore.

    $attr = array();
    for($i = 0; $i < 10; $i++) {
        $attr[] = ['Col'. $i, $i]; 
    }
    $request = [
        'table_name' => 'MyTable',
        'condition' => RowExistenceExpectationConst::CONST_IGNORE, // You can set the condition to IGNORE, EXPECT_EXIST, or EXPECT_NOT_EXIST.
        'primary_key' => [ // Set the primary key.
            ['PK0', 123],
            ['PK1', 'abc']
        ],
        'attribute_columns' => $attr
    ];
    $response = $otsClient->putRow ($request);
                
  • Example 2

    The following code provides an example on how to write a row that contains 10 attribute columns and write three versions of data for each column. In this example, a custom version number (timestamp) is used.

    $attr = array();
    $timestamp = getMicroTime();
    for($i = 0; $i < 10; $i++) {
        for($j = 0; $j < 3; $j++) {
            $attr[] = ['Col'. $i, $j, null, $timestamp+$j];
        }
    }
    $request = [
        'table_name' => 'MyTable',
        'condition' => RowExistenceExpectationConst::CONST_IGNORE, // You can set the condition to IGNORE, EXPECT_EXIST, or EXPECT_NOT_EXIST.
        'primary_key' => [ // Set the primary key.
            ['PK0', 123],
            ['PK1', 'abc']
        ],
        'attribute_columns' => $attr
    ];
    $response = $otsClient->putRow ($request);
                
  • Example 3

    The following code provides an example on how to write a row that contains 10 attribute columns and write three versions of data for each column. In this example, a condition that expects the row not to exist is set and a custom version number (timestamp) is used.

    $attr = array();
    $timestamp = getMicroTime();
    for($i = 0; $i < 10; $i++) {
        for($j = 0; $j < 3; $j++) {
            $attr[] = ['Col'. $i, $j, null, $timestamp+$j];
        }
    }
    $request = [
        'table_name' => 'MyTable',
        'condition' => RowExistenceExpectationConst::CONST_EXPECT_NOT_EXIST, // Configure the condition to write data when the expected row does not exist.
        'primary_key' => [ // Set the primary key.
            ['PK0', 123],
            ['PK1', 'abc']
        ],
        'attribute_columns' => $attr
    ];
    $response = $otsClient->putRow ($request);
                
  • Example 4

    The following code provides an example on how to write a row that contains 10 attribute columns and write three versions of data for each column. In this example, a condition that expects the row to exist and the Col0 value of the row to be greater than 100 is set and a custom version number (timestamp) is used.

    $attr = array();
    $timestamp = getMicroTime();
    for($i = 0; $i < 10; $i++) {
        for($j = 0; $j < 3; $j++) {
            $attr[] = ['Col'. $i, $j, null, $timestamp+$j];
        }
    }
    $request = [
        'table_name' => 'MyTable',
        'condition' => [
            'row_existence' => RowExistenceExpectationConst::CONST_EXPECT_EXIST, // Configure the condition to write data when the expected row exists.
            'column_condition' => [                  // If the condition is met, the data is updated.
                'column_name' => 'Col0',
                'value' => 100,
                'comparator' => ComparatorTypeConst::CONST_GREATER_THAN
            ]
        ,
        'primary_key' => [ // Set the primary key.
            ['PK0', 123],
            ['PK1', 'abc']
        ],
        'attribute_columns' => $attr
    ];
    $response = $otsClient->putRow ($request);
                

GetRow

You can call this operation to read a row of data.

The following results for the read request may be returned:
  • If the row exists, the primary key columns and attribute columns of the row are returned.
  • If the row does not exist, no row is returned and no error is reported.
  • Operations
        /**
         * Read a row of data.
         * @api
         * @param [] $request The request parameters.
         * @return [] The response. 
         * @throws OTSClientException The exception that is returned when a parameter error occurs or the Tablestore server returns a verification error.
         * @throws OTSServerException The exception that is returned when the Tablestore server returns an error.
         */
        public function getRow(array $request);
                
  • Request parameters
    Parameter Description
    table_name The name of the table.
    primary_key The primary key of the row.
    Note The configured number and types of primary key columns must be consistent with the actual number and types of primary key columns of the table.
    max_versions The maximum number of versions that can be read.
    Note You must specify at least one of max_versions and time_range.
    • If you specify only max_versions, data of up to the specified number of versions is returned from the latest to the earliest.
    • If you specify only time_range, data whose version number is within the specified range or a specified version of data is returned.
    • If you specify both max_versions and time_range, data of up to the specified number of versions within the time range is returned from the latest to the earliest.
    time_range Specifies a range of versions to read or a version of data to read. For more information, see TimeRange.
    Note You must specify at least one of max_versions and time_range.
    • If you specify only max_versions, data of up to the specified number of versions is returned from the latest to the earliest.
    • If you specify only time_range, data whose version number is within the specified range or a specified version of data is returned.
    • If you specify both max_versions and time_range, data of up to the specified number of versions within the time range is returned from the latest to the earliest.
    • If you specify a range of versions to read, you must set start_time and end_time. start_time indicates the start timestamp. end_time indicates the end timestamp. The specified range includes the start timestamp and excludes the end timestamp.
    • If you want to query data of a specified version, you must set specific_time. specific_time indicates a specified timestamp.

    You can set either of specific_time or [start_time, end_time).

    The timestamp used for the value of time_range ranges from 0 to INT64.MAX. Unit: milliseconds.

    columns_to_get The set of columns to read. The column name can be the primary key column or attribute column.

    If you do not specify this parameter, all data in the row is returned.

    Note
    • By default, Tablestore returns the data from all columns of the row when you query a row. You can set the columns_to_get parameter to return the data in specified columns. For example, if you include col0 and col1 in columns_to_get, only the values of col0 and col1 are returned.
    • If you use columns_to_get and column_filter together, Tablestore first queries the columns specified by columns_to_get, and then returns rows that meet the filter conditions.
    start_column The column from which you want to start reading. This parameter is used to read wide rows. The response contains the start column.

    The columns are sorted based on their names in alphabetical order. Example: A table contains columns a, b, and c. If the value of start_column is b, the reading starts from column b, and columns b and c are returned.

    end_column The column at which you want to end reading. This parameter is used to read wide rows. The response does not contain the end column.

    The columns are sorted based on their names in alphabetical order. Example: A table contains columns a, b, and c. If the value of end_column is b, the reading ends at column b, and column a is returned.

    token This parameter specifies the start position of a wide row in the next read operation. This feature is unavailable.
    column_filter You can set filter conditions to filter the queried results on the server side. Only rows that meet the specified filter conditions are returned. For more information, see Configure filter.
    Note If you use columns_to_get and column_filter together, Tablestore first queries the columns specified by columns_to_get, and then returns rows that meet the filter conditions.
  • Request format
    $result = $client->getRow([
        'table_name' => '<string>',                     // Set the table name.
        'primary_key' => [                              // Set the primary key.
            ['<string>', <PrimaryKeyValue>], 
            ['<string>', <PrimaryKeyValue>],
            ['<string>', <PrimaryKeyValue>, <PrimaryKeyType>]
        ], 
        'max_versions' => <integer>,
        'time_range' => [
            'start_time' => <integer>,
            'end_time' => <integer>,
            'specific_time' => <integer>
        ],
        'start_column' => '<string>',
        'end_column' => '<string>',
        'token' => '<string>',
        'columns_to_get' => [
            '<string>',
            '<string>',
            //...   
        ],
        'column_filter' =>  <ColumnCondition>
    ]);
                
  • Response parameters
    Parameter Description
    consumed The number of CUs consumed by this operation.
    capacity_unit: the number of read and write CUs consumed.
    • read: the read throughput
    • write: the write throughput
    primary_key The value of the primary key, which is consistent with that in the request.
    Note If the row does not exist, primary_key is an empty list [].
    attribute_columns The values of attribute columns.
    Note If the row does not exist, attribute_columns is an empty list [].
    • Each attribute column is specified by parameters in the following sequence: the attribute column name, attribute column value (ColumnValue), attribute column value type (ColumnType), and timestamp.

      A timestamp is a 64-bit integer, which indicate multiple versions of data.

    • The attribute columns in the response are sorted by attribute column name in ascending alphabetical order. The versions of the attribute columns are sorted by timestamp in descending order.
    • The order of attribute columns may be different between the request and response.
    next_token The start position of a wide row in the next read operation. This feature is unavailable.
  • Response format
    [
        'consumed' => [
            'capacity_unit' => [
                'read' => <integer>,
                'write' => <integer>
            ]
        ],
        'primary_key' => [ 
            ['<string>', <PrimaryKeyValue>], 
            ['<string>', <PrimaryKeyValue>],
            ['<string>', <PrimaryKeyValue>, <PrimaryKeyType>]
        ],  
        'attribute_columns' => [
                ['<string>', <ColumnValue>, <ColumnType>, <integer>]
                ['<string>', <ColumnValue>, <ColumnType>, <integer>]
                ['<string>', <ColumnValue>, <ColumnType>, <integer>]
        ],
        'next_token' => '<string>'
    ]
                
  • Example 1

    The following code provides an example on how to read the latest versions of the specified columns from a row:

    $request = [
        'table_name' => 'MyTable',
        'primary_key' => [ // Set the primary key.
            ['PK0', 123],
            ['PK1', 'abc']
        ],
        'max_versions' => 1,                     // Set this parameter to read the latest version.
        'columns_to_get' => ['Col0']             // Set the column to read.
    ];
    $response = $otsClient->getRow ($request);
                
  • Example 2

    The following code provides an example on how to set filter conditions to read a row of data:

    $request = [
        'table_name' => 'MyTable',
        'primary_key' => [ // Set the primary key.
            ['PK0', 123],
            ['PK1', 'abc']
        ],
        'max_versions' => 1,                     // Set this parameter to read the latest version.
        'column_filter' => [                     // Set the filter to return a row if the value of Col0 is 0.
            'column_name' => 'Col0',
            'value' => 0,
            'comparator' => ComparatorTypeConst::CONST_EQUAL,
            'pass_if_missing' => false          // If the Col0 column does not exist, the row is not returned.
        ]
    ];
    $response = $otsClient->getRow ($request);
                

UpdateRow

You can call this operation to update data of a specified row. You can add attribute columns to or delete attribute columns from a row, delete a specified version of data from an attribute column, or update the existing data in an attribute column. If the specified row does not exist, a new row is added.
Note If the UpdateRow request contains only columns to delete, and the specified row does not exist, a new row is not added.
  • Operations
        /**
         * Update a row of data.
         * @api
         * @param [] $request The request parameters.
         * @return [] The response.
         * @throws OTSClientException The exception that is returned when a parameter error occurs or the Tablestore server returns a verification error.
         * @throws OTSServerException The exception that is returned when the Tablestore server returns an error.
         */
        public function updateRow(array $request);
                
  • Request parameters
    Parameter Description
    table_name The name of the table.
    condition You can use conditional update to set a row existence condition or columns-based conditions for the row. For more information, see Configure conditional update.
    primary_key The primary key of the row.
    Note The configured number and types of primary key columns must be consistent with the actual number and types of primary key columns of the table.
    update_of_attribute_columns The attribute column to be updated.
    • An attribute column is specified by parameters in the following sequence: the attribute column name, attribute column value, attribute column value type (optional), and timestamp (optional).

      The timestamp is the version number of the data. It can be automatically generated or customized. If you do not specify this parameter, Tablestore automatically generates a timestamp. For more information, see Max versions and TTL.

      • The version number generated by Tablestore is calculated based on the number of milliseconds that have elapsed since 00:00:00 UTC on January 1, 1970.
      • When you choose to specify the version number, ensure that the version number is a 64-bit timestamp accurate to the millisecond within the valid version range.
    • To delete a specified version of data from an attribute column, you need only to set the attribute column name and timestamp.

      The timestamp is a 64-bit integer that indicates a specified version of data. Unit: milliseconds.

    • To delete an attribute column, you need only to set the attribute column name.
      Note A row exists even if all attribute columns in the row are deleted. To delete a row, use the DeleteRow operation.
    return_content The return type.

    return_type: Set the value to ReturnTypeConst::CONST_PK, which returns the primary key values. This parameter is used for auto-increment primary key columns.

  • Request format
    $result = $client->updateRow([
        'table_name' => '<string>', // Set the table name.
        'condition' => [
            'row_existence' => <RowExistence>,
            'column_condition' => <ColumnCondition>
        ],
        'primary_key' => [                              // Set the primary key.
            ['<string>', <PrimaryKeyValue>], 
            ['<string>', <PrimaryKeyValue>],
            ['<string>', <PrimaryKeyValue>, <PrimaryKeyType>]
        ], 
        'update_of_attribute_columns' => [         // Set the attribute column to update.
            'PUT' => [
                ['<string>', <ColumnValue>], 
                ['<string>', <ColumnValue>, <ColumnType>],
                ['<string>', <ColumnValue>, <ColumnType>, <integer>]
            ],
            'DELETE' => [
                ['<string>', <integer>], 
                ['<string>', <integer>], 
                ['<string>', <integer>], 
                ['<string>', <integer>]
            ],
            'DELETE_ALL' => [
                '<string>',
                '<string>',
                '<string>',
                '<string>'
            ],        
        ],
        'return_content' => [
            'return_type' => <ReturnType>
        ]
    ]);
                
  • Response parameters
    Parameter Description
    consumed The number of CUs consumed by this operation.
    capacity_unit: the number of read and write CUs consumed.
    • read: the read throughput
    • write: the write throughput
    primary_key The value of the primary key, which is consistent with that in the request.
    Note If you set return_type to ReturnTypeConst::CONST_PK, the value of the primary key is returned.
    attribute_columns The values of attribute columns. The attribute column names are consistent with those specified in the request. At present, the value of this paramter is empty.
  • Response format
    [
        'consumed' => [
            'capacity_unit' => [
                'read' => <integer>,
                'write' => <integer>
            ]
        ],
        'primary_key' => [ 
            ['<string>', <PrimaryKeyValue>], 
            ['<string>', <PrimaryKeyValue>],
            ['<string>', <PrimaryKeyValue>, <PrimaryKeyType>]
        ],  
        'attribute_columns' => []
    ]
                
  • Example 1

    The following code provides an example on how to update several columns, delete the specified version of a column, and delete the specified column:

    $request = [
        'table_name' => 'MyTable',
        'condition' => RowExistenceExpectationConst::CONST_IGNORE,
        'primary_key' => [ // Set the primary key.
            ['PK0', 123],
            ['PK1', 'abc']
        ],
        'update_of_attribute_columns' => [
            'PUT' => [                       // Update several columns.
                ['Col0', 100],
                ['Col1', 'Hello'],
                ['Col2', 'a binary', ColumnTypeConst::CONST_BINARY],
                ['Col3', 100, null, 1526418378526]
            ],
            'DELETE' => [                    // Delete a version of a column.
                ['Col10', 1526418378526]
            ],
            'DELETE_ALL' => [
                'Col11'                      // Delete a column.
            ]
        ]
    ];
    $response = $otsClient->updateRow($request);
                
  • Example 2

    The following code provides an example on how to configure update conditions:

    $request = [
        'table_name' => 'MyTable',
        'primary_key' => [ // Set the primary key.
            ['PK0', 123],
            ['PK1', 'abc']
        ],
        'condition' => [
            'row_existence' => RowExistenceExpectationConst::CONST_EXPECT_EXIST, // Update the row if it exists.
            'column_filter' => [                                                 // Update the row when the value of Col0 is greater than 100.
                'column_name' => 'Col0',
                'value' => 100,
                'comparator' => ComparatorTypeConst::CONST_GREATER_THAN
            ]
        ],    
        'update_of_attribute_columns' => [
            'PUT' => [                       // Update several columns.
                ['Col0', 100],
                ['Col1', 'Hello'],
                ['Col2', 'a binary', ColumnTypeConst::CONST_BINARY],
                ['Col3', 100, null, 1526418378526]
            ],
            'DELETE' => [                    // Delete a version of a column.
                ['Col10', 1526418378526]
            ],
            'DELETE_ALL' => [
                'Col11'                      // Delete a column.
            ]
        ]
    ];         

DeleteRow

You can call this operation to delete a row. If the row you want to delete does not exist, no changes are made to the table.

  • Operations
        /**
         * Delete a row of data.
         * @api
         * @param [] $request The request parameters.
         * @return [] The response. 
         * @throws OTSClientException The exception that is returned when a parameter error occurs or the Tablestore server returns a verification error.
         * @throws OTSServerException The exception that is returned when the Tablestore server returns an error.
         */
        public function deleteRow(array $request);
                
  • Request parameters
    Parameter Description
    table_name The name of the table.
    condition You can use conditional update to set a row existence condition or columns-based conditions for the row. For more information, see Configure conditional update.
    primary_key The primary key of the row.
    Note The configured number and types of primary key columns must be consistent with the actual number and types of primary key columns of the table.
    return_content The return type.

    return_type: Set the value to ReturnTypeConst::CONST_PK, which returns the primary key values. This parameter is used for auto-increment primary key columns.

  • Request format
    $result = $client->deleteRow([
        'table_name' => '<string>', // Set the table name.
        'condition' => [
            'row_existence' => <RowExistence>,
            'column_condition' => <ColumnCondition>
        ],
        'primary_key' => [                              // Set the primary key.
            ['<string>', <PrimaryKeyValue>], 
            ['<string>', <PrimaryKeyValue>],
            ['<string>', <PrimaryKeyValue>, <PrimaryKeyType>]
        ],
        'return_content' => [
            'return_type' => <ReturnType>
        ]
    ]);
                
  • Response parameters
    Parameter Description
    consumed The number of CUs consumed by this operation.
    capacity_unit: the number of read and write CUs consumed.
    • read: the read throughput
    • write: the write throughput
    primary_key The value of the primary key, which is consistent with that in the request.
    Note If you set return_type to ReturnTypeConst::CONST_PK, the value of the primary key is returned.
    attribute_columns The values of attribute columns. The attribute column names are consistent with those specified in the request. At present, the value of this paramter is empty.
  • Response format
    [
        'consumed' => [
            'capacity_unit' => [
                'read' => <integer>,
                'write' => <integer>
            ]
        ],
        'primary_key' => [
            ['<string>', <PrimaryKeyValue>], 
            ['<string>', <PrimaryKeyValue>],
            ['<string>', <PrimaryKeyValue>, <PrimaryKeyType>]
        ],
        'attribute_columns' => []
    ]
                
  • Example 1

    The following code provides an example on how to delete a row from a table:

    $request = [
        'table_name' => 'MyTable',
        'condition' => RowExistenceExpectationConst::CONST_IGNORE,
        'primary_key' => [ // Set the primary key.
            ['PK0', 123],
            ['PK1', 'abc']
        ],
        'return_content' => [
            'return_type' => ReturnTypeConst::CONST_PK     // Set return_type to return the value of the primary key for auto-increment primary key columns.
        ]
    ];
    $response = $otsClient->deleteRow($request);
                
  • Example 2

    The following code provides an example on how to set deletion conditions:

    $request = [
        'table_name' => 'MyTable',
        'condition' => [
            'row_existence' => RowExistenceExpectationConst::CONST_EXPECT_EXIST, // Delete the row if it exists.
            'column_filter' => [          // Delete the row when the value of Col0 is greater than 100.
                'column_name' => 'Col0',
                'value' => 100,
                'comparator' => ComparatorTypeConst::CONST_GREATER_THAN
            ],
        ],
        'primary_key' => [ // Set the primary key.
            ['PK0', 123],
            ['PK1', 'abc']
        ]
    ];
    $response = $otsClient->deleteRow ($request);