-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Feature] support regex_instr #36958
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
base: main
Are you sure you want to change the base?
Conversation
|
|
Conflicts: be/test/exprs/string_fn_test.cpp
|
This resolves #19616 |
docs/en/sql-reference/sql-functions/like-predicate-functions/regexp_instr.md
Show resolved
Hide resolved
| ## Syntax | ||
|
|
||
| ```Haskell | ||
| VARCHAR regexp_instr(VARCHAR str, VARCHAR pattern) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return int or bigint? what's the range?
docs/en/sql-reference/sql-functions/like-predicate-functions/regexp_instr.md
Show resolved
Hide resolved
| 'StringFunctions::regexp_extract_prepare', 'StringFunctions::regexp_close'], | ||
| [30322, 'regexp_instr', 'INT', ['VARCHAR', 'VARCHAR'], 'StringFunctions::regexp_instr', | ||
| 'StringFunctions::regexp_instr_prepare', 'StringFunctions::regexp_close'], | ||
| [30330, 'regexp_replace', 'VARCHAR', ['VARCHAR', 'VARCHAR', 'VARCHAR'], 'StringFunctions::regexp_replace', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-range the functions in the ascend order of function ID(s)
| context->set_error(error.str().c_str()); | ||
| return Status::InvalidArgument(error.str()); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take into consideration that the zeroth argument is also constant. for an example
select regex_instr('abcdef', 'ab[cd]*') from a_very_large_table
or implement constant folding of this function is ScalarOperatorFunctions.java
docs/zh/sql-reference/sql-functions/like-predicate-functions/regexp_instr.md
Outdated
Show resolved
Hide resolved
docs/zh/sql-reference/sql-functions/like-predicate-functions/regexp_instr.md
Outdated
Show resolved
Hide resolved
…gexp_instr Conflicts: be/src/exprs/string_functions.cpp
Why I'm doing:
What I'm doing:
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: