8000 JSON.GET writes exponents as 1e+21; RedisJSON writes 1e21 · Issue #473 · kividbio/kividb · GitHub
[go: up one dir, main page]

Skip to content

JSON.GET writes exponents as 1e+21; RedisJSON writes 1e21 #473

Open

Description

@murtazayusuf

KiviDB writes JSON with serde_json (json_text in src/commands/json.rs, and serde_json::to_vec in src/snapshot.rs and src/vector/mod.rs). serde_json 1.0.149 formats floats with zmij, which writes e+. So 1e21 comes back as 1e+21, and 18446744073709551616 as 1.8446744073709552e+19.

RedisJSON: its serde_json uses ryu, which writes 1e21 and 1.8446744073709552e19.

Both forms are valid JSON for the same value, but clients or tests that compare JSON.GET text byte for byte against Redis see a difference.

Possible fixes: rewrite e+ to e in the writer, or format floats with ryu.

Found while reviewing #463 (#445). RedisJSON's replies come from a byte-for-byte probe against Redis 8.10.3.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    redis-compatA test in Redis's own test suite fails against KiviDB

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0