DynamoDB expressions and PartiQL
The DynamoDB wire has three small languages: condition expressions (used for ConditionExpression, FilterExpression and KeyConditionExpression), update expressions, and PartiQL. All three are parsed and evaluated by the wire against items held in memory; none produces a LogicalPlan. The grammar summaries, error replies and tests are documented in DynamoDB API implementation reference, Expression languages; this page describes how the three relate and how they reach storage.
Translation path
(source: src/protocol/dynamodb/condition.rs, Condition::parse, Condition::eval; src/protocol/dynamodb/update.rs, Update::parse, Update::apply; src/protocol/dynamodb/partiql.rs, execute, module comment; src/protocol/dynamodb/mod.rs, legacy_conditions, check_condition, read)
Condition expressions
One grammar and one evaluator serve conditions on writes, filters on Query and Scan, and key conditions (source: src/protocol/dynamodb/condition.rs, Condition; src/protocol/dynamodb/mod.rs, check_condition, read).
| Element | Accepted |
|---|---|
| Comparators |
=, <>, <, <=, >, >=
|
| Ranges and lists |
a BETWEEN x AND y, a IN (x, y, ...)
|
| Functions |
attribute_exists(path), attribute_not_exists(path), attribute_type(path, type), begins_with(path, s), contains(path, v)
|
| Operand function | size(path) |
| Logic |
NOT, AND, OR (that precedence), parentheses |
| Paths | names, #placeholder, .member, [n]
|
| Values |
:placeholder only |
(source: src/protocol/dynamodb/condition.rs, tokenize, Parser, Condition::parse)
A bare attribute name that is one of the reserved words in RESERVED_WORDS is refused with "Attribute name is a reserved keyword; reserved keyword: X"; #name placeholders avoid it. An unknown placeholder or a syntax error is a ValidationException; a condition that fails to parse is never treated as true (source: src/protocol/dynamodb/condition.rs, RESERVED_WORDS, is_reserved_word). Numbers compare as integers when both parse as i128, otherwise as f64 (source: src/protocol/dynamodb/condition.rs, num_cmp, values_order).
ProjectionExpression uses the same path syntax, parsed by parse_projection and applied by project (source: src/protocol/dynamodb/condition.rs, parse_projection, project).
The legacy request parameters (Expected, KeyConditions, QueryFilter, ScanFilter) are converted to conditions by legacy_conditions; a legacy filter may not name a key attribute (source: src/protocol/dynamodb/mod.rs, legacy_conditions).
Tested by reserved_words_need_a_name_placeholder, existence, comparisons_and_logic, functions and errors_are_reported in src/protocol/dynamodb/condition.rs.
Update expressions
Clauses SET (with +, -, if_not_exists(path, v) and list_append(a, b)), REMOVE, ADD and DELETE, each at most once. All right-hand sides are evaluated against the item as it was before the update, then applied together, so SET a = b, b = a swaps. Overlapping paths are refused. Number arithmetic is exact decimal on i128 mantissas, not floating point (source: src/protocol/dynamodb/update.rs, Update::parse, Update::apply, decimal_add, parse_decimal).
Tested by decimal_math_is_exact, set_list_append_if_not_exists_and_remove, overlapping_paths_rejected and swap_reads_pre_update_image in src/protocol/dynamodb/update.rs.
PartiQL
SELECT * | path [, path ...] FROM "table"[."index"] [WHERE condition]
INSERT INTO "table" VALUE {'attr': value, ...}
UPDATE "table" (SET path = value [, ...] | REMOVE path [, ...])+ WHERE condition
[RETURNING ALL|MODIFIED NEW|OLD *]
DELETE FROM "table" WHERE condition [RETURNING ALL OLD *]
Values are 'strings', numbers, TRUE, FALSE, NULL, {maps}, [lists], <<sets>> and ? parameters taken from the request's Parameters. WHERE is rewritten into a condition expression and SET/REMOVE into an update expression, then run by the same evaluators as above. A statement that does not fit the grammar fails with "Statement wasn't well formed, can't be processed" (source: src/protocol/dynamodb/partiql.rs, module comment, MALFORMED, params_of, select, insert, update_stmt, delete).
ExecuteStatement runs one statement; BatchExecuteStatement answers each statement separately; ExecuteTransaction applies all or none (source: src/protocol/dynamodb/mod.rs, execute_statement, batch_execute_statement, execute_transaction).
Not verified: src/protocol/dynamodb/partiql.rs has no unit tests; its coverage comes only from the boto3 differential recorded in the proof pack (source: reference, Test coverage).
Storage and reachability from SQL
Items live in an in-memory DynamoTable per table, and writes are mirrored to the SQL tables _dynamo_tables (table_name, metadata) and _dynamo_items (table_name, item_key, data); GetItem falls back to _dynamo_items for a key not in memory (source: src/protocol/dynamodb/mod.rs, DynamoTable, get_item). SQL can read these tables; the _dynamo_ prefix makes them wire-internal, so a role that is not a superuser needs a GRANT (source: src/query/engine.rs, is_wire_internal_relation). DynamoDB expressions are not accepted on any SQL path.
Tests
condition.rs 5 and update.rs 4 unit tests, as named above; src/protocol/dynamodb/mod.rs has 9 unit tests that call handler methods directly; tests/protocol_dynamodb.rs has 31 tests on attribute values and the backing tables and sends no DynamoDB request. The boto3 deep differential against dynamodb-local is recorded as 64 of 65 matching, the difference being ReturnValues=UPDATED_OLD after a nested SET (source: reference, Test coverage; docs/status/2026-11-29-dynamodb-reserved-words.md).