-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-33597][SQL] Support REGEXP_LIKE for consistent with mainstream databases #30543
Conversation
Kubernetes integration test starting |
Kubernetes integration test status failure |
Test build #132487 has finished for PR 30543 at commit
|
retest this please |
Test build #132528 has finished for PR 30543 at commit
|
Kubernetes integration test starting |
Kubernetes integration test status failure |
retest this please |
Kubernetes integration test starting |
Kubernetes integration test status failure |
Test build #132534 has finished for PR 30543 at commit
|
Kubernetes integration test starting |
Test build #132923 has finished for PR 30543 at commit
|
Kubernetes integration test status success |
retest this please |
Test build #132932 has finished for PR 30543 at commit
|
retest this please |
Test build #132946 has finished for PR 30543 at commit
|
retest this please |
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 okay, seems fine. cc @cloud-fan and @gatorsmile FYI
Kubernetes integration test starting |
Kubernetes integration test status success |
Test build #132984 has finished for PR 30543 at commit
|
thanks, merging to master! |
What changes were proposed in this pull request?
There are a lot of mainstream databases support regex function
REGEXP_LIKE
.Currently, Spark supports
RLike
and we just need add a new aliasREGEXP_LIKE
for it.Oracle
https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Pattern-matching-Conditions.html#GUID-D2124F3A-C6E4-4CCA-A40E-2FFCABFD8E19
Presto
https://prestodb.io/docs/current/functions/regexp.html
Vertica
https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Functions/RegularExpressions/REGEXP_LIKE.htm?tocpath=SQL%20Reference%20Manual%7CSQL%20Functions%7CRegular%20Expression%20Functions%7C_____5
Snowflake
https://docs.snowflake.com/en/sql-reference/functions/regexp_like.html
Additional modifications
check outputs of expression examples
in ExpressionInfoSuite executes the example SQL of built-in function, so the below SQL be executed:SELECT '%SystemDrive%\Users\John' regexp_like '%SystemDrive%\\Users.*'
But Spark SQL not supports this syntax yet.
SELECT '%SystemDrive%\Users\John' _FUNC_ '%SystemDrive%\\Users.*';
is an SQL syntax, not the usecase for functionRLike
.As the above reason, this PR changes the example SQL of
RLike
.Why are the changes needed?
No
Does this PR introduce any user-facing change?
Make the behavior of Spark SQL consistent with mainstream databases.
How was this patch tested?
Jenkins test