Skip to content
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

feature: support REGEXP_INSTR function #4629

Merged
merged 2 commits into from
Mar 31, 2022

Conversation

nange
Copy link
Contributor

@nange nange commented Mar 30, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

  • Support REGEXP_INSTR function

Changelog

  • New Feature
  • Documentation

Related Issues

Fixes #3069

Test Plan

Unit Tests

Stateless Tests

@vercel
Copy link

vercel bot commented Mar 30, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/databend/databend/HgaUerMJ4bSr6opFWYGPqQwXtF51
✅ Preview: https://databend-git-fork-nange-feat-regexpinstrfunction-databend.vercel.app

@mergify
Copy link
Contributor

mergify bot commented Mar 30, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added pr-feature this PR introduces a new feature to the codebase pr-doc-fix labels Mar 30, 2022
@BohuTANG BohuTANG requested a review from Xuanwo March 30, 2022 09:46
@nange nange changed the title support REGEXP_INSTR function feature: support REGEXP_INSTR function Mar 30, 2022

let iter = izip!(source, pos, occur, ro);
for (s_value, pos_value, occur_value, ro_value) in iter {
if ro_value != 0 && ro_value != 1 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's constant column, so we don't need to check this inside the loop?

Just use let v = column.as_u64()? to check the value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my bad, ignore this.

@sundy-li sundy-li requested a review from b41sh March 30, 2022 14:39
@BohuTANG BohuTANG merged commit 0a2226a into databendlabs:main Mar 31, 2022
@nange nange deleted the feat/regexp_instr_function branch March 31, 2022 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-review pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REGEXP_INSTR() | Starting index of substring matching regular expression
4 participants