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

added logic to handle semicolon in the query #7861

Merged
merged 6 commits into from
Dec 6, 2021

Conversation

Manis99803
Copy link
Contributor

Description

Currently if we have a semicolon in the query, Pinot throws exception. However, semicolon are used in the SQL query to mark the termination of the query, and if a semicolon is present in the Pinot query exception shouldn't be thrown.
This PR implements the fix for the same

Issue Link: #7713

@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2021

Codecov Report

Merging #7861 (96af902) into master (e572ea0) will decrease coverage by 6.39%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #7861      +/-   ##
============================================
- Coverage     71.65%   65.26%   -6.40%     
+ Complexity     4080     4078       -2     
============================================
  Files          1581     1536      -45     
  Lines         81350    79486    -1864     
  Branches      12128    11926     -202     
============================================
- Hits          58293    51878    -6415     
- Misses        19117    23910    +4793     
+ Partials       3940     3698     -242     
Flag Coverage Δ
integration1 ?
integration2 ?
unittests1 68.78% <100.00%> (-0.02%) ⬇️
unittests2 14.49% <0.00%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
...org/apache/pinot/sql/parsers/CalciteSqlParser.java 90.96% <100.00%> (-1.00%) ⬇️
...a/org/apache/pinot/common/metrics/MinionMeter.java 0.00% <0.00%> (-100.00%) ⬇️
...g/apache/pinot/common/metrics/ControllerMeter.java 0.00% <0.00%> (-100.00%) ⬇️
.../apache/pinot/common/metrics/BrokerQueryPhase.java 0.00% <0.00%> (-100.00%) ⬇️
.../apache/pinot/common/metrics/MinionQueryPhase.java 0.00% <0.00%> (-100.00%) ⬇️
...he/pinot/common/messages/SegmentReloadMessage.java 0.00% <0.00%> (-100.00%) ⬇️
...pinot/core/data/manager/realtime/TimerService.java 0.00% <0.00%> (-100.00%) ⬇️
...pinot/minion/exception/TaskCancelledException.java 0.00% <0.00%> (-100.00%) ⬇️
...not/common/exception/HttpErrorStatusException.java 0.00% <0.00%> (-100.00%) ⬇️
...t/core/startree/plan/StarTreeDocIdSetPlanNode.java 0.00% <0.00%> (-100.00%) ⬇️
... and 356 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 e572ea0...96af902. Read the comment docs.

@richardstartin
Copy link
Member

Hi @Manis99803 this may not be the right approach because stripping semicolons in a context insensitive way will break when literals which contain semicolons.

@Manis99803
Copy link
Contributor Author

Hi @richardstartin ,
Thanks for the feedback, I get why this is not the right approach. I will work on the improvement and update the PR

@richardstartin
Copy link
Member

Looks good assuming the tests pass 👍🏻

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.

Thanks for the fix and adding the test

@xiangfu0 xiangfu0 merged commit 4dc2135 into apache:master Dec 6, 2021
kriti-sc pushed a commit to kriti-sc/incubator-pinot that referenced this pull request Dec 12, 2021
* added logic to handle semicolon in the query

* updated the logic to handle semicolon

* removed the comment

* updated comments

* added trim function to sql

* updated the logic of semicolon handling in the sql

Co-authored-by: Manish Soni <manisson@cisco.com>
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.

5 participants