Skip to content

Fix row keys merging distinct text rows in UNIQUE and grouping (#1012) - #1105

Merged
aiongg merged 1 commit into
storytold:mainfrom
MarekSpodBiedry:issue-1012
Oct 22, 2026
Merged

aiongg merged 1 commit into
storytold:mainfrom
MarekSpodBiedry:issue-1012

Conversation

@MarekSpodBiedry

Copy link
Copy Markdown
Contributor

Fixes #1012.

row_key in crates/functions/src/dynamic.rs joined the per-value keys with an unescaped U+0001, so a text value containing that character could shift a column boundary: the rows ["a", "b\u{1}tc"] and ["a\u{1}tb", "c"] produced the same key and were merged.

Each part is now written as <byte length>:<key>, which cannot be ambiguous whatever the text contains. key_of is unchanged, so case-insensitive matching and the number/text distinction stay as they were.

row_key is the single helper behind every affected path (UNIQUE, including exactly-once mode, GROUPBY and both PIVOTBY axes), so the one change covers all of them.

Test: unique_keeps_rows_containing_separator_apart uses the two rows from the issue and expects UNIQUE to keep both; it returns one row without the fix. The existing unique test still covers ordinary case-insensitive duplicates.

@MarekSpodBiedry
MarekSpodBiedry marked this pull request as ready for review October 13, 2026 16:10
@aiongg
aiongg merged commit a0a4b6a into storytold:main Oct 22, 2026
1 check passed
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(functions): delimiter-based row keys merge distinct text rows in UNIQUE and grouping

2 participants