[BUG] Preserve DynamoDB N and NS numeric fidelity during decoding

未关闭
#110 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@allenkim0129 已经在做这个了。

开始于 2026年9月16日。

  • #112 来自 @allenkim0129 —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
java
领域
databases

调研方向

定位 DynamoItemMapper 的实现,以及现有的 read、query、update 和 number-set 往返测试。首先跟踪 N 和 NS 字符串如何变成 Jackson 节点,然后验证高精度小数、指数形式和超出范围的整数在解码和重新编码过程中保留其数值。可移植的数值边界应当明确,正如验收标准所要求的那样。

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

描述

bug java

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

  1. Store an N value with more precision than binary64 can represent, such as a 38-digit DynamoDB decimal.
  2. Store a valid DynamoDB integral value outside the Java long range.
  3. Read the item or decode the same values through an NS attribute.
  4. 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

  • N and every member of NS decode without binary64 precision loss.
  • Valid DynamoDB integers outside the Java long range 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

环境准备

从这里开始

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

microsoft/multiclouddb-sdk-for-java 的其他 Issue

查看 microsoft/multiclouddb-sdk-for-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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