Skip to content

Compare ByteString keys in KeyComparisons - #4876

Draft
hatyo wants to merge 1 commit into
FoundationDB:mainfrom
hatyo:ordered-bytes-union-compare
Draft

hatyo wants to merge 1 commit into
FoundationDB:mainfrom
hatyo:ordered-bytes-union-compare

Conversation

@hatyo

@hatyo hatyo commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Fix a ClassCastException when a Cascades union compares by to_ordered_bytes(...) and two legs tie on the preceding key columns.

A Cascades union sorted through an order function such as
`order_desc_nulls_last` compares by `to_ordered_bytes(...)`, which evaluates to
a `ByteString`. `FIELD_COMPARATOR` handled `byte[]` but not `ByteString`, so
the comparison fell through to `Comparable` and threw a `ClassCastException`
as soon as two legs tied on the preceding key columns. Compare them unsigned
lexicographically, which is the order the ordered-bytes encoding is built for.

This branch has not been deployed

No deployments
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.

1 participant