Scan Select rules and the Query ALL_PROJECTED_ATTRIBUTES rule answer without the "1 validation error detected: " prefix

未关闭 适合新手
#832 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
64/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
backend

调研方向

从 crates/core/src/validation/mod.rs 中的 validate_select_projection 开始,根据列出的 Select 和 projection 规则比较 Scan 和 Query 的前缀处理。使用 issue 中测量的请求案例检查响应文本;当受影响的 Scan 和 Query 响应符合所述的 DynamoDB 行为,且已报告为匹配的规则仍然正确时,即为完成。

由索引模型根据 Issue 内容生成。

描述

Scan answers the three Select rules without the 1 validation error detected: prefix the service sends, and Query answers the ALL_PROJECTED_ATTRIBUTES rule without it.

Measured against Amazon DynamoDB in us-east-1 on 4 November 2026, each request twice, both answers identical, on tables created for the run (pk S HASH and sk S RANGE; the same with an LSI lsi1; pk N HASH). ExtendDB answers are from a SQLite server built from main 25ee109bf, each request twice, both answers identical.

Request Service ExtendDB main 25ee109bf
Scan, "Select": "SPECIFIC_ATTRIBUTES" and no AttributesToGet or ProjectionExpression 1 validation error detected: Must specify the AttributesToGet or ProjectionExpression when choosing to get SPECIFIC_ATTRIBUTES Must specify the AttributesToGet or ProjectionExpression when choosing to get SPECIFIC_ATTRIBUTES
Scan, "Select": "ALL_ATTRIBUTES" with a ProjectionExpression 1 validation error detected: Cannot specify the ProjectionExpression when choosing to get ALL_ATTRIBUTES the same text without the prefix
Scan, "Select": "COUNT" with a ProjectionExpression 1 validation error detected: Cannot specify the ProjectionExpression when choosing to get only the Count the same text without the prefix
Scan of the LSI table, "Select": "ALL_PROJECTED_ATTRIBUTES", "IndexName": "lsi1" and a ProjectionExpression 1 validation error detected: Cannot specify the ProjectionExpression when choosing to get ALL_PROJECTED_ATTRIBUTES the same text without the prefix
Scan, "Select": "ALL_PROJECTED_ATTRIBUTES" and no IndexName 1 validation error detected: ALL_PROJECTED_ATTRIBUTES can be used only when Querying using an IndexName the same text without the prefix
Query pk = :p, "Select": "ALL_PROJECTED_ATTRIBUTES" and no IndexName the same as the row above the same text without the prefix

The SPECIFIC_ATTRIBUTES row was also sent on Scan beside a valid ExclusiveStartKey, beside a malformed and a wrong-typed one, beside "Limit": 1, beside a FilterExpression, and on the N hash key table: the service sends the prefix in all six, and ExtendDB leaves it out in all six.

On Query the service and ExtendDB agree on the other rules: SPECIFIC_ATTRIBUTES alone and beside a valid ExclusiveStartKey, and ALL_ATTRIBUTES and COUNT with a ProjectionExpression, all with the prefix.

Where the answer comes from

validate_select_projection in crates/core/src/validation/mod.rs adds the prefix when is_query is set and leaves it out for Scan, for the SPECIFIC_ATTRIBUTES rule and the rule for a Select that cannot carry a ProjectionExpression. A comment there cites measurements of 24 August 2026 for the split. The ALL_PROJECTED_ATTRIBUTES rule returns its text without the prefix for both operations.

主要语言
Rust
星标
517
派生
60
平均合并
5 天 1 小时
30 天内合并 PR
67

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ExtendDB/extenddb 的其他 Issue

查看 ExtendDB/extenddb 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。