execute_statement
¶
execute_statement(
statement: PartiQLStatement,
*,
config_overrides: Optional[DynamoDBClientConfig] = None,
parameters: Optional[PreparedStatementParameters] = None,
consistent_read: Optional[ConsistentRead] = None,
next_token: Optional[PartiQLNextToken] = None,
return_consumed_capacity: Optional[ReturnConsumedCapacity] = None,
limit: Optional[PositiveIntegerObject] = None,
return_values_on_condition_check_failure: Optional[
ReturnValuesOnConditionCheckFailure
] = None,
) -> ExecuteStatementOutput
This operation allows you to perform reads and singleton writes on data stored in DynamoDB, using PartiQL.
For PartiQL reads (SELECT statement), if the total number of processed items exceeds the maximum dataset size limit of 1 MB, the read stops and results are returned to the user as a LastEvaluatedKey value to continue the read in a subsequent operation. If the filter criteria in WHERE clause does not match any data, the read will return an empty result set.
A single SELECT statement response can return up to the maximum number of items (if using the Limit parameter) or a maximum of 1 MB of data (and then apply any filtering to the results using WHERE clause). If LastEvaluatedKey is present in the response, you need to paginate the result set. If NextToken is present, you need to paginate the result set and include NextToken.
Parameters:
-
statement(PartiQLStatement) –The PartiQL statement representing the operation to run.
-
parameters(Optional[PreparedStatementParameters], default:None) –The parameters for the PartiQL statement, if any.
-
consistent_read(Optional[ConsistentRead], default:None) –The consistency of a read operation. If set to
true, then a strongly consistent read is used; otherwise, an eventually consistent read is used. -
next_token(Optional[PartiQLNextToken], default:None) –Set this value to get remaining results, if
NextTokenwas returned in the statement response. -
limit(Optional[PositiveIntegerObject], default:None) –The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, along with a key in
LastEvaluatedKeyto apply in a subsequent operation so you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key inLastEvaluatedKeyto apply in a subsequent operation to continue the operation. -
return_values_on_condition_check_failure(Optional[ReturnValuesOnConditionCheckFailure], default:None) –An optional parameter that returns the item attributes for an
ExecuteStatementoperation that failed a condition check.There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.
Raises:
-
ConditionalCheckFailedException–A condition specified in the operation failed to be evaluated.
-
DuplicateItemException–There was an attempt to insert an item with the same primary key as an item that already exists in the DynamoDB table.
-
InternalServerError–An error occurred on the server side.
-
ItemCollectionSizeLimitExceededException–An item collection is too large. This exception is only returned for tables that have one or more local secondary indexes.
-
ProvisionedThroughputExceededException–The request was denied due to request throttling. For detailed information about why the request was throttled and the ARN of the impacted resource, find the ThrottlingReason field in the returned exception. The Amazon Web Services SDKs for DynamoDB automatically retry requests that receive this exception. Your request is eventually successful, unless your retry queue is too large to finish. Reduce the frequency of requests and use exponential backoff. For more information, go to Error Retries and Exponential Backoff in the Amazon DynamoDB Developer Guide.
-
RequestLimitExceeded–Throughput exceeds the current throughput quota for your account. For detailed information about why the request was throttled and the ARN of the impacted resource, find the ThrottlingReason field in the returned exception. Contact Amazon Web Services Support to request a quota increase.
-
ResourceNotFoundException–The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be
ACTIVE. -
ThrottlingException–The request was denied due to request throttling. For detailed information about why the request was throttled and the ARN of the impacted resource, find the ThrottlingReason field in the returned exception.
-
TransactionConflictException–Operation was rejected because there is an ongoing transaction for the item.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_dynamodb/_services/dynamo_db.py
1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 | |