Skip to content

[SPARK-59063][SQL] Use byte-length guard in LikeSimplification - #58374

Open
marcuslin123 wants to merge 1 commit into
apache:masterfrom
marcuslin123:codex/spark-59063-like-byte-length
Open

[SPARK-59063][SQL] Use byte-length guard in LikeSimplification#58374
marcuslin123 wants to merge 1 commit into
apache:masterfrom
marcuslin123:codex/spark-59063-like-byte-length

Conversation

@marcuslin123

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR changes the prefix%suffix branch of LikeSimplification to use
OctetLength with the UTF-8 byte lengths of the prefix and suffix. It also
updates the optimizer plan tests and adds SPARK-59063 coverage for multibyte
UTF-8 characters.

Why are the changes needed?

Length scans every input string to count code points. OctetLength reads the
stored UTF-8 byte length in constant time, while the existing StartsWith and
EndsWith predicates continue to enforce the pattern boundaries.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

build/sbt catalyst/scalastyle catalyst/Test/scalastyle \
  'catalyst/testOnly org.apache.spark.sql.catalyst.optimizer.LikeSimplificationSuite'

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Codex (GPT-5) for code assistance.

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