mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-28 12:17:02 +00:00
In the DynamoDB API, UpdateItem's AttributeUpdates parameter (the older syntax, which was superseded by UpdateExpression) has a DELETE operation that can do two different things: It can delete an attribute, or it can delete elements from a set. Before this patch we only implemented the first feature, and this patch implements the second. Note that unlike the ordinary delete, the second feature - set subtraction - is a read-modify-write operation. This is not only because of Alternator's serialization (as JSON strings, not CRDTs) - but also fundementally because of the API's guarantees - e.g., the operation is supposed to fail if the attribute's existing value is *not* a set of the correct type, so it needs to read the old value. The test for this feature begins to pass, so its "xfail" mark is removed. After this, all tests in test/alternator/test_item.py pass :-) Fixes #5864. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20211103151206.157184-1-nyh@scylladb.com>