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
Add regexp_position and regexp_count functions #2136
Conversation
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: unknown.
|
Thanks for creating this PR. Could you confirm a commit author and squash commits into one? Also, I would recommend updating AbstractTestRegexpFunctions.java and regexp.rst. If you need help, you can join our community Slack. https://prestosql.io/slack.html |
7210983
to
d663552
Compare
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: unknown.
|
d663552
to
c5e205f
Compare
c0d17a0
to
acd0ee5
Compare
Can anyone help me review this PR? |
5ca4783
to
6e235b5
Compare
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/Re2JRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/Re2JRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/operator/scalar/AbstractTestRegexpFunctions.java
Show resolved
Hide resolved
6ea75df
to
cbaf23c
Compare
@ssquan please click re-review button when you are ready with changes |
.. function:: regexp_position(string, pattern) -> integer | ||
|
||
Returns the index of the first occurrence of ``pattern`` in ``string``. | ||
Returns -1 if not found, otherwise returns index counting from 1. |
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.
@martint could you check this function contract?
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
cbaf23c
to
93a961c
Compare
3526f64
to
a34a895
Compare
presto-main/src/test/java/io/prestosql/operator/scalar/AbstractTestRegexpFunctions.java
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/Re2JRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/Re2JRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/operator/scalar/AbstractTestRegexpFunctions.java
Outdated
Show resolved
Hide resolved
1bd7dce
to
7ffeb23
Compare
6cb8dd2
to
d0fc396
Compare
Don't use merge commit, just rebase |
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.
some comments
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/Re2JRegexpFunctions.java
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/operator/scalar/AbstractTestRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/operator/scalar/AbstractTestRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/operator/scalar/AbstractTestRegexpFunctions.java
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/operator/scalar/AbstractTestRegexpFunctions.java
Show resolved
Hide resolved
00eb236
to
24777e2
Compare
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.
some minor comments
presto-main/src/main/java/io/prestosql/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/operator/scalar/AbstractTestRegexpFunctions.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/operator/scalar/AbstractTestRegexpFunctions.java
Show resolved
Hide resolved
24777e2
to
99f6374
Compare
Merged, thanks! |
Fixes #2133
function list:
three regexp_instr methods
one regexp_count method