[BUG] Preserve DynamoDB N and NS numeric fidelity during decoding
评估
调研方向
定位 DynamoItemMapper 的实现,以及现有的 read、query、update 和 number-set 往返测试。首先跟踪 N 和 NS 字符串如何变成 Jackson 节点,然后验证高精度小数、指数形式和超出范围的整数在解码和重新编码过程中保留其数值。可移植的数值边界应当明确,正如验收标准所要求的那样。
由索引模型根据 Issue 内容生成。
描述
Bug description
DynamoItemMapper currently decodes DynamoDB N and NS strings through Java primitive parsers. Decimal values are converted through Double.parseDouble(...), which can silently lose DynamoDB's native decimal precision, and integral values outside the long range cannot be represented by the current fallback.
The behavior affects read/query/update result fidelity and predates #105, so it should be fixed independently of partial update.
Provider
- Azure Cosmos DB
- Amazon DynamoDB
- Google Cloud Spanner
- Not provider-specific
Reproduction steps
- Store an
Nvalue with more precision than binary64 can represent, such as a 38-digit DynamoDB decimal. - Store a valid DynamoDB integral value outside the Java
longrange. - Read the item or decode the same values through an
NSattribute. - Compare the returned Jackson nodes with the native numeric strings.
Expected behaviour
The mapper preserves native DynamoDB numeric fidelity (for example with DecimalNode/BigIntegerNode) until the portable API applies its explicitly documented numeric contract.
Actual behaviour
Decimal values can be silently rounded to binary64, and large integral values can fail during primitive parsing.
Acceptance criteria
-
Nand every member ofNSdecode without binary64 precision loss. - Valid DynamoDB integers outside the Java
longrange are handled deterministically. - Encoding the decoded node back to DynamoDB preserves the numeric value.
- Read, query, and partial-update round-trip tests cover high-precision decimals, exponent forms, large positive/negative integers, and number sets.
- Integration with the future portable numeric boundary is explicit rather than an accidental mapper conversion.
Additional context
Related umbrella issues: #37 and #64.
- 主要语言
- Java
- 星标
- 7
- 派生
- 7
- 平均合并
- 3 天 18 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/multiclouddb-sdk-for-java 的其他 Issue
-
Portable document key fields differ across Cosmos/Dynamo and read/query (id vs sortKey)可能重新可做 @allenkim0129 于 32 天前认领,目前没有进行中的 PR。 未关闭
microsoft/multiclouddb-sdk-for-java#121 · 已指派 1 人 ·
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 28/100
查看 microsoft/multiclouddb-sdk-for-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
NationalSecurityAgency/ghidra#10149 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 90/100
yegor256/antlr2ebnf-maven-plugin#155 ·
维护者通常 1 天内回复
-
account bug exercise lecture programming user interface
难度 2/5 1-3 小时 新手友好度 72/100
ls1intum/Artemis#14512 · 1 条评论 ·
维护者通常 1 天内回复
-
kind:bug priority:major
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
swiftlang/swift-java#955 ·
维护者通常 1 天内回复