rethinkdb / rethinkdb/docs

Document internal serialization formats, because they matter for PKs (as they're size-limited)

Open
#1,205 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
118
Forks
161
PR merge metrics
No merged PRs in 30d

Description

Pasted from https://github.com/rethinkdb/rethinkdb/issues/6304 -- see for some responses.


Please consider documenting how arrays are serialized, in regards to their use for primary keys. On RethinkDB 2.3.5, a simple r.table("test").get([...]) query shows me this error:

Primary key too long (max 127 characters): [
	123,
	1234567890,
	123,
	"foobar12",
	"0123456789abcdefghijklmnopqrstuvwxyz0123456"
] in ...

I've incorrectly assumed - for no particular reason, just had the impression - that the format was JSON or alike, but it doesn't seem to be the case. At least, I can't imagine how this data could be 128 octets-long (value is accepted if I remove any single character anywhere). Result of r.expr([123, 1234567890, 123, "foobar12", "0123456789abcdefghijklmnopqrstuvwxyz0123456"]).toJsonString().count() is 77, and use of info() on such expression returns a 88-character value (because of extra \ns and \ts).

Can someone please enlighten me? Thanks a lot!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the linked RethinkDB issue and reproduce the shown primary-key query with the array value. Compare the reported primary-key limit with toJsonString() and info() results, then document the actual internal serialization rules and size calculation for array primary keys.

Written by the indexing model from the issue text.

Assessment

Domain
databases, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.