-
Notifications
You must be signed in to change notification settings - Fork 752
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_REPLACE function #4944
feature: support REGEXP_REPLACE function #4944
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
/review @sundy-li |
Thanks for the contribution! Please review the labels and make any necessary changes. |
Take the reviewer to sundy-li |
@@ -100,6 +100,10 @@ impl Function for RegexpLikeFunction { | |||
mt, | |||
)?)) | |||
} | |||
|
|||
fn passthrough_constant(&self) -> bool { |
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.
I think it's incorrect.
passthrough_constant
only works when all arguments are constant. So it's ok to check_get
ConstColumn.
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.
Thanks, fixed. And I also have simplified some of the code for regexp_like function.
@@ -69,7 +74,7 @@ impl Function for RegexpInStrFunction { | |||
} | |||
|
|||
fn return_type(&self) -> DataTypePtr { | |||
u64::to_data_type() | |||
NullableType::arc(u64::to_data_type()) |
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.
Why do we return NullableType
and disable_passthrough_null
?
It makes the code more complex.
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.
Oh, it's same as snowflake did.
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.
Yes. If we enable the passthrough_null
, we can't know original of the argument(eg. pos) is 0
or null
in eval
function.
…e for regexp_like function
I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/
Summary
regexp_*
functions (the same as snowflake)Changelog
Related Issues
Fixes #3057