Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CASSANDRA-20102: Support octet_length and length functions #3707

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

jolynch
Copy link
Contributor

@jolynch jolynch commented Nov 23, 2024

Previously users would either have to read the data and check the length themselves or enable UDF and register UDFs to check the length of columns. This patch adds a subset of the SQL99 (binary) string functions: "octet_length" defined on all types and "length" defined on UTF8 strings.

Currently this just supports the OCTET_LENGTH SQL99 function for returning number of bytes and not the helpers like BIT_LENGTH or CHAR_LENGTH (or the rest) and supports the LENGTH function from PostgreSQL which is the number of UTF8 codepoints similar to Java String#length().

Test coverage includes unit tests and fuzz tests, but I need to port the fuzz test to quicktheories.

Previously users would either have to read the data and check the length
themselves or enable UDF and register UDFs to check the length of
columns. This patch adds a subset of the SQL99 (binary) string
functions: "octet_length" defined on all types and "length" defined on
UTF8 strings.

Patch by Joey Lynch; reviewed by <Reviewers> for CASSANDRA-20102
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