Repository navigation
fix(select): add the validation prefix to the ALL_PROJECTED_ATTRIBUTES refusal - #583
Conversation
…S refusal Amazon DynamoDB answers Select=ALL_PROJECTED_ATTRIBUTES without an IndexName with `1 validation error detected: ALL_PROJECTED_ATTRIBUTES can be used only when Querying using an IndexName`, on Query (with a KeyConditionExpression, with legacy KeyConditions, with ConsistentRead true or false) and on Scan (measured 2026-10-25 at 21:13 and 21:53 UTC, each request twice). ExtendDB sent the sentence without the prefix on both. Query and Scan share the refusal in validate_select_projection, so the text changes there. handle_scan holds a second copy of the sentence after the index lookup, which the shared check always reaches first; it gets the same text so a later reorder of the Scan checks cannot bring the old one back.
pdf-amzn
left a comment
There was a problem hiding this comment.
Nothing blocking. Consider these followups, especially 2 (unreachable code). What follows is AI generated:
Nit-or-follow-up: tests/test_select_all_projected_attributes.py:52. The PR table lists "no ConsistentRead" as a measured Query form, but the parametrization only covers False/True. Add None (omit the parameter) to cover all three measured forms.
Nit-or-follow-up: crates/engine/src/scan.rs:376-383. The PR says this second copy is unreachable, since validate_select_projection always rejects first, and no test can exercise it. Either delete it, or keep it and add a comment saying it is a backstop that mirrors validate_select_projection, so a later edit updates both.
Nit-or-follow-up: crates/core/src/validation/mod.rs:1634-1635 (unchanged). The comment says DynamoDB omits the prefix on Scan for Cannot specify the ProjectionExpression when choosing to get …, but this PR's own measurement says the service prefixes it on Scan for ALL_PROJECTED_ATTRIBUTES. Open an issue so the comment and the is_query split get re-measured (ALL_ATTRIBUTES and COUNT too). This PR does not need to change it.
Nit-or-follow-up: tests/test_query_scan.py:488, tests/test_query_scan.py:661, tests/rust/src/select_projection_validation.rs:60. These still check the sentence as a substring, so they would pass if the prefix regressed. The new file covers the regression, so tightening them is optional.
Nit-or-follow-up (pre-existing, listed by the PR as not changed): two parity gaps remain. A missing table answers ResourceNotFoundException before the Select check; the service answers the Select error. ALL_PROJECTED_ATTRIBUTES plus AttributesToGet answers the IndexName sentence instead of Cannot specify the AttributesToGet when choosing to get ALL_PROJECTED_ATTRIBUTES. Track both under #489.
Part of #489 (row O3).
Select=ALL_PROJECTED_ATTRIBUTESwithout anIndexNamenow answers with the1 validation error detected:prefix DynamoDB uses, on Query and on Scan.What the service answers
Measured on 2026-10-25 at 21:13 and 21:53 UTC in us-east-1, each request sent twice with the same answer:
KeyConditionExpression, noConsistentRead1 validation error detected: ALL_PROJECTED_ATTRIBUTES can be used only when Querying using an IndexNameKeyConditionExpression,ConsistentReadfalseKeyConditionExpression,ConsistentReadtrueKeyConditionsMain sends the sentence without the prefix on all five.
The change
Query and Scan share the refusal in
validate_select_projection(crates/core/src/validation/mod.rs), so the text changes there.handle_scanholds a second copy of the sentence after the index lookup. The shared check always answers first for these requests, so that copy is not reached today; it gets the same text so a later reorder of the Scan checks cannot bring the old one back.Tests
tests/test_select_all_projected_attributes.py: 4 dual-target wire tests, one per measured Query form and one for Scan, asserting the full message.Run locally on 2026-10-25 against SQLite release builds:
tests/test_query_scan.py(116) andtests/test_wording_parity_validation.py(7) pass at the head and on main; they assert the sentence as a substring;tests/test_query_scan.py,tests/test_wording_parity_validation.pyand every test whose name containstest_scan, 158 passed;cargo +1.97.0 fmt --all -- --check,cargo +1.97.0 clippy -p extenddb-engine -p extenddb-core --all-targets -- -D warnings, andcargo test -p extenddb-engine -p extenddb-core(698 passed).CI runs the new file in
run-integration,run-integration-sqlite,mongodb-pytestandcassandra-pytest.Not changed here
Measured in the same runs, on main and unchanged by this PR:
ALL_PROJECTED_ATTRIBUTESon a table that does not exist: the service answers the sentence above, ExtendDB answers ResourceNotFoundException, because it resolves the table first.ALL_PROJECTED_ATTRIBUTESandAttributesToGet: the service answers1 validation error detected: Cannot specify the AttributesToGet when choosing to get ALL_PROJECTED_ATTRIBUTES; ExtendDB answers the IndexName sentence.FilterExpressionsyntax fault next toALL_PROJECTED_ATTRIBUTES: both report the filter first, with different wording (Syntax error; token: "=", near: "="on the service).ALL_PROJECTED_ATTRIBUTESand aProjectionExpression: the service prefixesCannot specify the ProjectionExpression when choosing to get ALL_PROJECTED_ATTRIBUTES; ExtendDB leaves it bare on Scan, and the code comment beside it says the service does.ALL_ATTRIBUTESandCOUNTwith aProjectionExpressionon Scan were not measured.Merging
git merge-tree --write-treeadds no conflict against any of the 13 open PRs that changecrates/core/src/validation/mod.rs, nor #562, which changes it through its base. #416, #395 and #200 conflict with main in the same files with or without this commit. #481 and #479 assert this sentence withendswith, so their tests pass after this lands; their comments saying ExtendDB omits the prefix become stale.