Skip to content

Conversation

@liuzhixing1006
Copy link

@liuzhixing1006 liuzhixing1006 commented Dec 13, 2023

Why I'm doing:

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@liuzhixing1006 liuzhixing1006 requested a review from a team as a code owner December 13, 2023 08:32
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 13, 2023
@liuzhixing1006 liuzhixing1006 changed the title [Feature] support regex_instr #19616 [Feature] support regex_instr Dec 13, 2023
Conflicts:
	be/test/exprs/string_fn_test.cpp
@liuzhixing1006
Copy link
Author

This resolves #19616

## Syntax

```Haskell
VARCHAR regexp_instr(VARCHAR str, VARCHAR pattern)
Copy link
Contributor

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?

'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',
Copy link
Contributor

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());
}

Copy link
Contributor

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

@DanRoscigno DanRoscigno removed the documentation Improvements or additions to documentation label Oct 25, 2024
@stdpain stdpain self-assigned this Jul 2, 2025
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.

7 participants