Shekharrajak opened a new pull request, #3207:
URL: https://github.com/apache/datafusion-comet/pull/3207
Closes #3182
## Rationale for this change
Enable native execution for Spark's `RIGHT(str, len)` function to improve
query performance by avoiding JVM fallback.
## What changes are included in this PR?
- Added `CometRight` serializer that handles edge cases:
- len <= 0: Returns empty string literal
- len > 0: Transforms to `Substring(str, -len, len)` protobuf
- Registered `Right` expression in `QueryPlanSerde` string expressions map
- No protobuf or Rust changes required (reuses existing Substring
implementation)
## How are these changes tested?
Added 4 test suites in `CometExpressionSuite`:
- Basic functionality (various lengths: 0, -1, positive, exceeds length)
- Unicode character handling (emoji, multi-byte chars)
- Equivalence verification with `SUBSTRING(str, -len, len)`
- Dictionary encoding preservation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]