Skip to content

fix(select): add the validation prefix to the ALL_PROJECTED_ATTRIBUTES refusal - #583

Merged
pdf-amzn merged 1 commit into
mainfrom
fix/query-all-projected-prefix
Nov 10, 2026
Merged

pdf-amzn merged 1 commit into
mainfrom
fix/query-all-projected-prefix

Conversation

@LeeroyHannigan

Copy link
Copy Markdown
Collaborator

Part of #489 (row O3).

Select=ALL_PROJECTED_ATTRIBUTES without an IndexName now answers with the 1 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:

Request Answer
Query, KeyConditionExpression, no ConsistentRead 1 validation error detected: ALL_PROJECTED_ATTRIBUTES can be used only when Querying using an IndexName
Query, KeyConditionExpression, ConsistentRead false same
Query, KeyConditionExpression, ConsistentRead true same
Query, legacy KeyConditions same
Scan same

Main 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_scan holds 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:

  • at the first commit: the new file 4 passed; on main 4 failed, each on the missing prefix alone;
  • tests/test_query_scan.py (116) and tests/test_wording_parity_validation.py (7) pass at the head and on main; they assert the sentence as a substring;
  • at the head, with the second copy changed: the new file, tests/test_query_scan.py, tests/test_wording_parity_validation.py and every test whose name contains test_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, and cargo test -p extenddb-engine -p extenddb-core (698 passed).

CI runs the new file in run-integration, run-integration-sqlite, mongodb-pytest and cassandra-pytest.

Not changed here

Measured in the same runs, on main and unchanged by this PR:

  • Query with ALL_PROJECTED_ATTRIBUTES on a table that does not exist: the service answers the sentence above, ExtendDB answers ResourceNotFoundException, because it resolves the table first.
  • Query with ALL_PROJECTED_ATTRIBUTES and AttributesToGet: the service answers 1 validation error detected: Cannot specify the AttributesToGet when choosing to get ALL_PROJECTED_ATTRIBUTES; ExtendDB answers the IndexName sentence.
  • A FilterExpression syntax fault next to ALL_PROJECTED_ATTRIBUTES: both report the filter first, with different wording (Syntax error; token: "=", near: "=" on the service).
  • Scan with ALL_PROJECTED_ATTRIBUTES and a ProjectionExpression: the service prefixes Cannot 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_ATTRIBUTES and COUNT with a ProjectionExpression on Scan were not measured.

Merging

git merge-tree --write-tree adds no conflict against any of the 13 open PRs that change crates/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 with endswith, so their tests pass after this lands; their comments saying ExtendDB omits the prefix become stale.

…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 pdf-amzn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pdf-amzn
pdf-amzn added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 4ee13f9 Nov 10, 2026
34 checks passed
@pdf-amzn
pdf-amzn deleted the fix/query-all-projected-prefix branch November 10, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v1 Needed for the 1.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants