[AURON #2132] Add native support for instr function#2133
Closed
weimingdiit wants to merge 1 commit intoapache:masterfrom
Closed
[AURON #2132] Add native support for instr function#2133weimingdiit wants to merge 1 commit intoapache:masterfrom
weimingdiit wants to merge 1 commit intoapache:masterfrom
Conversation
Signed-off-by: weimingdiit <weimingdiit@gmail.com>
9e6d976 to
c3b61d0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes ##2132
Rationale for this change
To improve compatibility with Spark SQL string functions, we should support
instr(str, substr)with Spark-compatible semantics.Expected behavior
Function name:
instr(str, substr)Return value:
substrinstr0ifsubstris not found1ifsubstris an empty stringNULLif either argument isNULLExamples:
instr('hello', 'll')->3instr('hello', 'x')->0instr('hello', '')->1This behavior should match Spark SQL and work consistently for literal and expression inputs.
What changes are included in this PR?
This PR adds support for the Spark SQL
instr()function in the native conversion path.The following changes are included:
StringInstrexpression support inNativeConvertersinstr(str, substr)to the existing nativestrposscalar functionAre there any user-facing changes?
NO.
How was this patch tested?
CI.