-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Refactor query rewriter to interfaces and implementations #7576
Conversation
6b31182
to
8c91a2a
Compare
Codecov Report
@@ Coverage Diff @@
## master #7576 +/- ##
============================================
- Coverage 71.61% 64.23% -7.38%
+ Complexity 3884 3804 -80
============================================
Files 1552 1550 -2
Lines 79012 78705 -307
Branches 11705 11668 -37
============================================
- Hits 56585 50559 -6026
- Misses 18618 24549 +5931
+ Partials 3809 3597 -212
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Nice work! It makes the parser much cleaner
pinot-common/src/main/java/org/apache/pinot/sql/parsers/visitor/QueryVisitor.java
Outdated
Show resolved
Hide resolved
|
||
|
||
public interface QueryVisitor { | ||
void visit(PinotQuery pinotQuery); |
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.
Let's add some javadoc for the class and method?
For the rewrite, should we return a PinotQuery
or always rewrite in-place? For now in-place is enough, not sure about the future rewriters
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.
Good point, since we are not following visitor model, then I can change the return type to PinotQuery, it's up to each implementation to decide if it's in-place or create new.
pinot-common/src/main/java/org/apache/pinot/sql/parsers/visitor/QueryVisitorFactory.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/sql/parsers/visitor/QueryVisitorFactory.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/sql/parsers/visitor/QueryVisitorFactory.java
Outdated
Show resolved
Hide resolved
55df822
to
f8ce84c
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.
LGTM otherwise
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/sql/parsers/rewriter/QueryRewriterFactory.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/sql/parsers/rewriter/QueryRewriterFactory.java
Outdated
Show resolved
Hide resolved
pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java
Outdated
Show resolved
Hide resolved
b6bc8d5
to
6368eec
Compare
6368eec
to
a008154
Compare
Description
queryVisitorsClassNames
to allow override the default query rewriter class names.Upgrade Notes
Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)
backward-incompat
, and complete the section below on Release Notes)Does this PR fix a zero-downtime upgrade introduced earlier?
backward-incompat
, and complete the section below on Release Notes)Does this PR otherwise need attention when creating release notes? Things to consider:
release-notes
and complete the section on Release Notes)Release Notes
Documentation