Skip to content

Fix RowBinary tuple encoding re-normalizing nested types#378

Open
SAY-5 wants to merge 1 commit into
plausible:masterfrom
SAY-5:fix-tuple-normalized-nested-encode
Open

Fix RowBinary tuple encoding re-normalizing nested types#378
SAY-5 wants to merge 1 commit into
plausible:masterfrom
SAY-5:fix-tuple-normalized-nested-encode

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 18, 2026

Copy link
Copy Markdown

Fixes #367.

encode({:tuple, types}, values) called the public encode_row/2, which runs encoding_types/1 again. The tuple's field types were already normalized by encoding_type({:tuple, ts}), so encoding a tuple with a normalized nested type like DateTime64 or Time64 re-applied time_unit/1 to an already-computed value (e.g. 1000) and raised FunctionClauseError.

Switched the tuple clause to the private _encode_row/2, which assumes normalized types and skips the second pass. Added a round-trip regression test for Tuple(DateTime64(3, 'UTC')) and Tuple(Time64(6)).

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix RowBinary tuple encoding re-normalizing nested types

1 participant