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

Introduce LIKE Operator #7214

Merged
merged 14 commits into from
Aug 12, 2021
Merged

Introduce LIKE Operator #7214

merged 14 commits into from
Aug 12, 2021

Conversation

atris
Copy link
Contributor

@atris atris commented Jul 27, 2021

This commit introduces LIKE operator as defined by SQL92 standard.

Currently, our only way to be matching text fields is to either define regexes and use REGEXP_LIKE or define Lucene syntax and use TEXT_MATCH function.

SQL 92 defines the LIKE operator, which allows for exact matches (FOO like "BAR") and subquery matches (FOO LIKE "%AR").

Having the LIKE operator brings us closer to the SQL standard, allows users to migrate to us in an easier form and allows third party SQL tools to work on top of us.

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2021

Codecov Report

Merging #7214 (d0c1f7f) into master (717940b) will decrease coverage by 43.64%.
The diff coverage is 22.47%.

❗ Current head d0c1f7f differs from pull request most recent head 4e7d221. Consider uploading reports for the commit 4e7d221 to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##             master    #7214       +/-   ##
=============================================
- Coverage     73.45%   29.80%   -43.65%     
+ Complexity       92       86        -6     
=============================================
  Files          1508     1496       -12     
  Lines         73939    73891       -48     
  Branches      10682    10697       +15     
=============================================
- Hits          54309    22023    -32286     
- Misses        16066    49880    +33814     
+ Partials       3564     1988     -1576     
Flag Coverage Δ
integration ?
integration1 29.80% <22.47%> (?)
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...e/pinot/common/minion/MergeRollupTaskMetadata.java 0.00% <0.00%> (ø)
...e/pinot/common/minion/MinionTaskMetadataUtils.java 60.00% <ø> (+5.45%) ⬆️
...ot/common/request/context/RequestContextUtils.java 74.12% <0.00%> (-10.88%) ⬇️
...n/utils/LikeToRegexpLikePatternConverterUtils.java 0.00% <0.00%> (ø)
...troller/helix/core/minion/ClusterInfoAccessor.java 53.33% <0.00%> (-18.10%) ⬇️
.../org/apache/pinot/core/common/MinionConstants.java 0.00% <ø> (ø)
...ata/manager/realtime/RealtimeTableDataManager.java 41.46% <0.00%> (-26.44%) ⬇️
...ion/tasks/BaseSingleSegmentConversionExecutor.java 73.77% <0.00%> (ø)
...l/indexsegment/immutable/ImmutableSegmentImpl.java 0.00% <ø> (-65.58%) ⬇️
...local/indexsegment/mutable/MutableSegmentImpl.java 0.00% <0.00%> (-78.66%) ⬇️
... and 1130 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 717940b...4e7d221. Read the comment docs.

@atris
Copy link
Contributor Author

atris commented Jul 27, 2021

@Jackie-Jiang @mayankshriv Updated the PR, please see and let me know.

@Jackie-Jiang
Copy link
Contributor

@siddharthteotia Does text match has same semantic as sql like? I thought text match uses the lucene query syntax

@Jackie-Jiang
Copy link
Contributor

Syntax for SQL LIKE: https://www.w3schools.com/sql/sql_like.asp

@siddharthteotia
Copy link
Contributor

TEXT_MATCH uses Lucene query syntax for term, phrase, regex, fuzzy, boolean etc queries. Is SQL LIKE compliant with lucene query syntax ?

@atris
Copy link
Contributor Author

atris commented Aug 5, 2021

TEXT_MATCH uses Lucene query syntax for term, phrase, regex, fuzzy, boolean etc queries. Is SQL LIKE compliant with lucene query syntax ?

No, it is not. I have updated the PR to reflect the same.

@kishoreg
Copy link
Member

kishoreg commented Aug 5, 2021

Thanks @atris for taking this up. can you please add some sample queries to the description and explain what happens before/after this PR.

@atris
Copy link
Contributor Author

atris commented Aug 5, 2021

Thanks @atris for taking this up. can you please add some sample queries to the description and explain what happens before/after this PR.

Thank you, updated

@atris
Copy link
Contributor Author

atris commented Aug 11, 2021

@Jackie-Jiang Please see and let me know your comments

@atris atris requested a review from Jackie-Jiang August 11, 2021 09:01
@atris
Copy link
Contributor Author

atris commented Aug 12, 2021

@Jackie-Jiang Please see

Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

@Jackie-Jiang Jackie-Jiang merged commit 0ea617f into apache:master Aug 12, 2021
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