You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Lars Volker (Code Review)" <ge...@cloudera.org> on 2016/11/11 10:15:15 UTC
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Lars Volker has uploaded a new change for review.
http://gerrit.cloudera.org:8080/5051
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
IMPALA-4163: Add sortby() query hint
This change introduces the sortby() query plan hint for insert
statements. When specified, sortby(a, b) will add an additional sort
step to the plan to order data by columns a, b before inserting it into
the target table.
Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
---
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
A fe/src/main/java/org/apache/impala/analysis/PlanHint.java
M fe/src/main/java/org/apache/impala/analysis/SelectList.java
M fe/src/main/java/org/apache/impala/analysis/TableRef.java
M fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
M fe/src/main/java/org/apache/impala/planner/Planner.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
9 files changed, 332 insertions(+), 79 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/51/5051/1
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 3:
I moved the parsing code into the lexer and parser. This changed some of the error behavior, where errors that used to be caught in analysis are now caught during parsing. I also rebased the change since it depended on the "clustered" hint which was recently merged.
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Marcel Kornacker (Code Review)" <ge...@cloudera.org>.
Marcel Kornacker has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 3:
(18 comments)
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/cup/sql-parser.cup
File fe/src/main/cup/sql-parser.cup:
Line 370: nonterminal List<PlanHint> opt_plan_hints, plan_hint_list;
do you really need both? why not have a non-existing hint = empty hint list?
Line 2397: | /* empty */
what's the point of this?
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
File fe/src/main/java/org/apache/impala/analysis/InsertStmt.java:
Line 127: // Contains the result exprs corresponding to the columns of the target table, that are
what do you mean by result exprs? are these basetbl exprs?
Line 774: private void analyzeSortByColumns(List<String> columnNames) throws AnalysisException {
use line breaks where it makes sense.
also, describe the rules for sort-by columns somewhere.
analyzeSortByHint is more general (and correct)
Line 787: } else {
you'd also take this branch for hbase
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/java/org/apache/impala/analysis/PlanHint.java
File fe/src/main/java/org/apache/impala/analysis/PlanHint.java:
Line 34: private final String hintName_;
remove 'hint' from members, this class already contains 'hint' in its name.
Line 62: public String toString() {
toSql test missing
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/java/org/apache/impala/analysis/TableRef.java
File fe/src/main/java/org/apache/impala/analysis/TableRef.java:
Line 87: // ArrayList initialization each.
yes, please do.
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/java/org/apache/impala/planner/Planner.java
File fe/src/main/java/org/apache/impala/planner/Planner.java:
PS3, Line 511: clustered/noclustered plan
: * hint and the sortby()
"on the clustered/noclustered/sortby plan hint" is shorter
Line 515: * will also sort by all columns specified in the sortby() hint.
rewrite comment, instead of just tacking on
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/jflex/sql-scanner.flex
File fe/src/main/jflex/sql-scanner.flex:
Line 331: HintContent = [ ]* "+" [^\r\n*]*
isn't [ ]* the same as " "*?
Line 336: ContainsCommentEnd = [^]* "*/" [^]*
what is [^]*?
shouldn't 'anything' be simply ".*"?
Line 342: TraditionalComment = "/*" !({HintContent}|{ContainsCommentEnd}) "*/"
why do you need the ContainsCommentEnd here? wouldn't /* */ */ simply be a parse error?
Line 434: yybegin(HINT);
shouldn't this only apply to end-of-line hints?
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
File fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java:
Line 1776: "partition (year, month) %sshuffle,clustered,sortby(int_col,bool_col)%s " +
mix up the order a bit
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/test/java/org/apache/impala/analysis/ParserTest.java
File fe/src/test/java/org/apache/impala/analysis/ParserTest.java:
Line 216: ParserError("select 1 /*+ sortby(() */");
also check that this is illegal:
/* +sortby()\n
and
-- +sortby() */ \n
Line 477: "insert into t %sSoRtBy( a , , ,,, b )%s select * from t", prefix, suffix));
is the capitalization necessary?
http://gerrit.cloudera.org:8080/#/c/5051/3/testdata/workloads/functional-planner/queries/PlannerTest/insert.test
File testdata/workloads/functional-planner/queries/PlannerTest/insert.test:
Line 758: /*+ clustered,sortby(int_col, bool_col) */
move clustered to end
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Dan Hecht (Code Review)" <ge...@cloudera.org>.
Dan Hecht has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 6: Code-Review+2
Carry +2.
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 6
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dh...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has uploaded a new patch set (#3).
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
IMPALA-4163: Add sortby() query hint
This change introduces the sortby() query plan hint for insert
statements. When specified, sortby(a, b) will add an additional sort
step to the plan to order data by columns a, b before inserting it into
the target table.
Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
---
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
A fe/src/main/java/org/apache/impala/analysis/PlanHint.java
M fe/src/main/java/org/apache/impala/analysis/SelectList.java
M fe/src/main/java/org/apache/impala/analysis/TableRef.java
M fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
M fe/src/main/java/org/apache/impala/planner/Planner.java
M fe/src/main/jflex/sql-scanner.flex
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M testdata/workloads/functional-planner/queries/PlannerTest/insert.test
M testdata/workloads/functional-query/queries/QueryTest/insert.test
12 files changed, 432 insertions(+), 109 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/51/5051/3
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 1:
(15 comments)
Add planner and end-to-end tests
http://gerrit.cloudera.org:8080/#/c/5051/1/fe/src/main/cup/sql-parser.cup
File fe/src/main/cup/sql-parser.cup:
Line 2248: {: RESULT = PlanHint.parsePlanHintsString(l); :}
Isn't it easier overall (testing, etc.) to allow the legacy hint style as well? I though that's what we settled on.
http://gerrit.cloudera.org:8080/#/c/5051/1/fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
File fe/src/main/java/org/apache/impala/analysis/InsertStmt.java:
Line 128: // that will be written into the columns referenced in that hint. The list is populated
The comment says it but maybe more explicit that the hint references columns of the target table (and not e.g., the column labels of the feeding select stmt)
http://gerrit.cloudera.org:8080/#/c/5051/1/fe/src/main/java/org/apache/impala/analysis/PlanHint.java
File fe/src/main/java/org/apache/impala/analysis/PlanHint.java:
Line 32: * query statements. Plan consist of a name and an optional list of arguments.
A hint consists of ...
Line 34: // TODO: Should we make this class a proper ParseNode?
Don't think so, unless it's really directly produced by the parser.
Line 42: /// TODO: This is code that parses parts of the query (the sortby hint). It would be
Agree. We'll need to change the lexer as well. Might be a tricky. Let's investigate this option together.
We could also generate a new plan hint parser, but let's first try the regex solution. Seems like that should be easy and readable enough.
Line 45: throws AnalysisException {
weird to throw an AnalysisException from the parser, consider just throwing Exception
Line 46: ArrayList<PlanHint> hints = Lists.newArrayList();
This code looks a little scary. Could it be simplified with a regex? I understand the error reporting may not be as nice as with this custom solution, but I think code simplicity may trump that in this case.
Line 112: /// Check wether this hint equals to a given string, ignoring case.
typo: whether
Line 113: public boolean is(String s) { return hintName_.equals(s.toLowerCase()); }
equalsIgnoreCase
http://gerrit.cloudera.org:8080/#/c/5051/1/fe/src/main/java/org/apache/impala/planner/Planner.java
File fe/src/main/java/org/apache/impala/planner/Planner.java:
Line 495: * Insert a sort node on top of the plan, depending on the clustered/noclustered plan
update comment
Line 510: orderingExprs.addAll(insertStmt.getSortByExprs());
nice!
http://gerrit.cloudera.org:8080/#/c/5051/1/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
File fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java:
Line 1723: public void TestInsertHints() throws AnalysisException {
don't we test the clustered hint here?
Line 1777: prefix, suffix), "Could not find SORTBY hint column foo in table.");
in target table
but 'foo' in single quotes
Line 1782: "SORTBY hint column list must not contain Hdfs partition columns.");
mention the offending column name
Line 1786: "SORTBY hint column list must not contain Kudu primary key columns.");
mention the offending column
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 4:
(7 comments)
Thanks for the review. Please see PS5.
http://gerrit.cloudera.org:8080/#/c/5051/4/fe/src/main/java/org/apache/impala/analysis/SelectList.java
File fe/src/main/java/org/apache/impala/analysis/SelectList.java:
Line 74: if (planHints != null) planHints_ = planHints;
> assert != null
They could actually be null, since the parser just forwards its results to here. I corrected this in the parser and added the assertions.
http://gerrit.cloudera.org:8080/#/c/5051/4/fe/src/main/java/org/apache/impala/analysis/TableRef.java
File fe/src/main/java/org/apache/impala/analysis/TableRef.java:
Line 274: if (hints != null) this.joinHints_ = hints;
> assert that hints != null
Done
Line 278: if (hints != null) this.tableHints_ = hints;
> same
Done
http://gerrit.cloudera.org:8080/#/c/5051/4/fe/src/main/java/org/apache/impala/planner/Planner.java
File fe/src/main/java/org/apache/impala/planner/Planner.java:
Line 513: * contain the clustering columns (key columns for Kudu tables), so that partitions can
> they won't just "contain" (in an unspecified position), the ordering column
Done
http://gerrit.cloudera.org:8080/#/c/5051/4/fe/src/main/jflex/sql-scanner.flex
File fe/src/main/jflex/sql-scanner.flex:
PS4, Line 326: [ ]*
> also change to " "* (and wherever else it applies)
Done
Line 349: %state HINT
> rename to EOLHINT then
Done
Line 447: {CommentedHintEnd} {
> move below the corresponding 'begin' rule
Done
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Internal Jenkins (Code Review)" <ge...@cloudera.org>.
Internal Jenkins has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 7: Verified-1
Build failed: http://sandbox.jenkins.cloudera.com/job/impala-external-gerrit-verify-merge-ASF/659/
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 7
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dh...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 3:
(18 comments)
Thanks for the review. Please see PS4.
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/cup/sql-parser.cup
File fe/src/main/cup/sql-parser.cup:
Line 370: nonterminal List<PlanHint> opt_plan_hints, plan_hint_list;
> do you really need both? why not have a non-existing hint = empty hint list
I'm not sure I understood your comment. I think we need three separate classes here, since we need to 1) remove/handle the opening and closing comment characters ("/* */" and "-- \n" respectively), 2) be able to parse a list of uniform tokens, and 3) parse the individual hints. Together with the quirk that "straight_join" may exists as a single keyword outside them all I couldn't find a way to get rid of either. Do you have a suggestion?
Line 2397: | /* empty */
> what's the point of this?
We support empty hint tokens, tested in ParserTest.java#L512 . Should we remove that support? If so, I'd suggest opening a Jira to track removal with the next compat-breaking release.
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
File fe/src/main/java/org/apache/impala/analysis/InsertStmt.java:
Line 127: // Contains the result exprs corresponding to the columns of the target table, that are
> what do you mean by result exprs? are these basetbl exprs?
It contains the same exprs as resultExprs_ below. I added that to the comment.
Line 774: private void analyzeSortByColumns(List<String> columnNames) throws AnalysisException {
> use line breaks where it makes sense.
Added line breaks, described rules in the field comment above, renamed the method.
Line 787: } else {
> you'd also take this branch for hbase
hbase tables don't support insert hints, which is enforced in L740. I added a comment.
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/java/org/apache/impala/analysis/PlanHint.java
File fe/src/main/java/org/apache/impala/analysis/PlanHint.java:
Line 34: private final String hintName_;
> remove 'hint' from members, this class already contains 'hint' in its name.
Done
Line 62: public String toString() {
> toSql test missing
ToSqlTest.java already tests plan hints. I added a sortby() hint there, to make sure that the parentheses also get printed as expected.
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/java/org/apache/impala/analysis/TableRef.java
File fe/src/main/java/org/apache/impala/analysis/TableRef.java:
Line 87: // ArrayList initialization each.
> yes, please do.
Done
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/java/org/apache/impala/planner/Planner.java
File fe/src/main/java/org/apache/impala/planner/Planner.java:
PS3, Line 511: clustered/noclustered plan
: * hint and the sortby()
> "on the clustered/noclustered/sortby plan hint" is shorter
Done
Line 515: * will also sort by all columns specified in the sortby() hint.
> rewrite comment, instead of just tacking on
Done
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/jflex/sql-scanner.flex
File fe/src/main/jflex/sql-scanner.flex:
Line 331: HintContent = [ ]* "+" [^\r\n*]*
> isn't [ ]* the same as " "*?
Yes, they are the same. I went with [ ]* because it was like that before. Should I change it to " "*?
Line 336: ContainsCommentEnd = [^]* "*/" [^]*
> what is [^]*?
No. The dot does not match newlines.
From: http://jflex.de/manual.html
Dot (.) matches [^\r\n\u2028\u2029\u000B\u000C\u0085].
Line 342: TraditionalComment = "/*" !({HintContent}|{ContainsCommentEnd}) "*/"
> why do you need the ContainsCommentEnd here? wouldn't /* */ */ simply be a
Jflex greedily processes the longest match it can find for any regular expression. Thus it would strip /* */ */ as a single comment and accept it, instead of it being a parser error. Similarly, without this clause, multiple query hints spanning multiple lines will be discarded as a comment:
select * from T join U /* +shuffle */ \n join V /* +broadcast */...
will discard all hints as one comment (since !{HintContent} doesn't apply, due to the newline.
Line 434: yybegin(HINT);
> shouldn't this only apply to end-of-line hints?
Done
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
File fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java:
Line 1776: "partition (year, month) %sshuffle,clustered,sortby(int_col,bool_col)%s " +
> mix up the order a bit
Done
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/test/java/org/apache/impala/analysis/ParserTest.java
File fe/src/test/java/org/apache/impala/analysis/ParserTest.java:
Line 216: ParserError("select 1 /*+ sortby(() */");
> also check that this is illegal:
Done
Line 477: "insert into t %sSoRtBy( a , , ,,, b )%s select * from t", prefix, suffix));
> is the capitalization necessary?
No, removed it.
http://gerrit.cloudera.org:8080/#/c/5051/3/testdata/workloads/functional-planner/queries/PlannerTest/insert.test
File testdata/workloads/functional-planner/queries/PlannerTest/insert.test:
Line 758: /*+ clustered,sortby(int_col, bool_col) */
> move clustered to end
Done
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Internal Jenkins (Code Review)" <ge...@cloudera.org>.
Internal Jenkins has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 6: Verified-1
Build failed: http://sandbox.jenkins.cloudera.com/job/impala-external-gerrit-verify-merge-ASF/658/
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 6
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dh...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Marcel Kornacker (Code Review)" <ge...@cloudera.org>.
Marcel Kornacker has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 4:
(8 comments)
http://gerrit.cloudera.org:8080/#/c/5051/4/fe/src/main/java/org/apache/impala/analysis/SelectList.java
File fe/src/main/java/org/apache/impala/analysis/SelectList.java:
Line 74: if (planHints != null) planHints_ = planHints;
assert != null
as it is, a null param will simply leave planHints_ unchanged, which is counterintuitive.
http://gerrit.cloudera.org:8080/#/c/5051/4/fe/src/main/java/org/apache/impala/analysis/TableRef.java
File fe/src/main/java/org/apache/impala/analysis/TableRef.java:
Line 274: if (hints != null) this.joinHints_ = hints;
assert that hints != null
Line 278: if (hints != null) this.tableHints_ = hints;
same
http://gerrit.cloudera.org:8080/#/c/5051/4/fe/src/main/java/org/apache/impala/planner/Planner.java
File fe/src/main/java/org/apache/impala/planner/Planner.java:
Line 513: * contain the clustering columns (key columns for Kudu tables), so that partitions can
they won't just "contain" (in an unspecified position), the ordering columns will be the clustering columns, followed the sort-by cols.
http://gerrit.cloudera.org:8080/#/c/5051/3/fe/src/main/jflex/sql-scanner.flex
File fe/src/main/jflex/sql-scanner.flex:
Line 331: HintContent = [ ]* "+" [^\r\n]*
> Yes, they are the same. I went with [ ]* because it was like that before. S
yes, please do, [ ]* feels a bit indirect
http://gerrit.cloudera.org:8080/#/c/5051/4/fe/src/main/jflex/sql-scanner.flex
File fe/src/main/jflex/sql-scanner.flex:
PS4, Line 326: [ ]*
also change to " "* (and wherever else it applies)
Line 349: %state HINT
rename to EOLHINT then
Line 447: {CommentedHintEnd} {
move below the corresponding 'begin' rule
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Internal Jenkins (Code Review)" <ge...@cloudera.org>.
Internal Jenkins has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 8: Verified+1
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 8
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dh...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has uploaded a new patch set (#2).
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
IMPALA-4163: Add sortby() query hint
This change introduces the sortby() query plan hint for insert
statements. When specified, sortby(a, b) will add an additional sort
step to the plan to order data by columns a, b before inserting it into
the target table.
Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
---
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
A fe/src/main/java/org/apache/impala/analysis/PlanHint.java
M fe/src/main/java/org/apache/impala/analysis/SelectList.java
M fe/src/main/java/org/apache/impala/analysis/TableRef.java
M fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
M fe/src/main/java/org/apache/impala/planner/Planner.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M testdata/workloads/functional-planner/queries/PlannerTest/insert.test
M testdata/workloads/functional-query/queries/QueryTest/insert.test
11 files changed, 440 insertions(+), 88 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/51/5051/2
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has uploaded a new patch set (#4).
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
IMPALA-4163: Add sortby() query hint
This change introduces the sortby() query plan hint for insert
statements. When specified, sortby(a, b) will add an additional sort
step to the plan to order data by columns a, b before inserting it into
the target table.
Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
---
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
A fe/src/main/java/org/apache/impala/analysis/PlanHint.java
M fe/src/main/java/org/apache/impala/analysis/SelectList.java
M fe/src/main/java/org/apache/impala/analysis/TableRef.java
M fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
M fe/src/main/java/org/apache/impala/planner/Planner.java
M fe/src/main/jflex/sql-scanner.flex
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java
M testdata/workloads/functional-planner/queries/PlannerTest/insert.test
M testdata/workloads/functional-query/queries/QueryTest/insert.test
13 files changed, 478 insertions(+), 132 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/51/5051/4
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has uploaded a new patch set (#5).
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
IMPALA-4163: Add sortby() query hint
This change introduces the sortby() query plan hint for insert
statements. When specified, sortby(a, b) will add an additional sort
step to the plan to order data by columns a, b before inserting it into
the target table.
Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
---
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
A fe/src/main/java/org/apache/impala/analysis/PlanHint.java
M fe/src/main/java/org/apache/impala/analysis/SelectList.java
M fe/src/main/java/org/apache/impala/analysis/TableRef.java
M fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
M fe/src/main/java/org/apache/impala/planner/Planner.java
M fe/src/main/jflex/sql-scanner.flex
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java
M testdata/workloads/functional-planner/queries/PlannerTest/insert.test
M testdata/workloads/functional-query/queries/QueryTest/insert.test
13 files changed, 497 insertions(+), 149 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/51/5051/5
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Internal Jenkins (Code Review)" <ge...@cloudera.org>.
Internal Jenkins has submitted this change and it was merged.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
IMPALA-4163: Add sortby() query hint
This change introduces the sortby() query plan hint for insert
statements. When specified, sortby(a, b) will add an additional sort
step to the plan to order data by columns a, b before inserting it into
the target table.
Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Reviewed-on: http://gerrit.cloudera.org:8080/5051
Reviewed-by: Marcel Kornacker <ma...@cloudera.com>
Tested-by: Internal Jenkins
---
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
A fe/src/main/java/org/apache/impala/analysis/PlanHint.java
M fe/src/main/java/org/apache/impala/analysis/SelectList.java
M fe/src/main/java/org/apache/impala/analysis/TableRef.java
M fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
M fe/src/main/java/org/apache/impala/planner/Planner.java
M fe/src/main/jflex/sql-scanner.flex
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java
M testdata/workloads/functional-planner/queries/PlannerTest/insert.test
M testdata/workloads/functional-query/queries/QueryTest/insert.test
13 files changed, 490 insertions(+), 140 deletions(-)
Approvals:
Marcel Kornacker: Looks good to me, approved
Internal Jenkins: Verified
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 9
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dh...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 1:
(14 comments)
Thank you for the review. Please see my comments and PS2.
http://gerrit.cloudera.org:8080/#/c/5051/1/fe/src/main/cup/sql-parser.cup
File fe/src/main/cup/sql-parser.cup:
Line 2248: {: RESULT = PlanHint.parsePlanHintsString(l); :}
> Isn't it easier overall (testing, etc.) to allow the legacy hint style as w
So far it was. However, legacy hints [foo,bar] are handled by the parser, and changing those to allow hints with arguments seems to much trouble.
Let's work on moving hint parsing into the parser and see whether it is easier to allow legacy hints afterwards.
http://gerrit.cloudera.org:8080/#/c/5051/1/fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
File fe/src/main/java/org/apache/impala/analysis/InsertStmt.java:
Line 128: // that will be written into the columns referenced in that hint. The list is populated
> The comment says it but maybe more explicit that the hint references column
Done
http://gerrit.cloudera.org:8080/#/c/5051/1/fe/src/main/java/org/apache/impala/analysis/PlanHint.java
File fe/src/main/java/org/apache/impala/analysis/PlanHint.java:
Line 32: * query statements. Plan consist of a name and an optional list of arguments.
> A hint consists of ...
Done
Line 34: // TODO: Should we make this class a proper ParseNode?
> Don't think so, unless it's really directly produced by the parser.
Ok, I'll keep this TODO for now until we have decided how to parse plan hints.
Line 42: /// TODO: This is code that parses parts of the query (the sortby hint). It would be
> Agree. We'll need to change the lexer as well. Might be a tricky. Let's inv
I'm afraid I'm not following completely. The options I understood are:
- Move parsing of plan hints to the lexer/parser
- Split out a completely new plan hint parser based on CUP
- Use regular expressions below to simplify the code, but keep parsing code within this class
Which one should we try first? I have already tried option 1 (lexer/parser) last week and couldn't get it to work easily. Eventually I gave up and wrote the code below to make progress on the overall change. I'll happily try again if you're confident it should work.
Line 45: throws AnalysisException {
> weird to throw an AnalysisException from the parser, consider just throwing
Done
Line 46: ArrayList<PlanHint> hints = Lists.newArrayList();
> This code looks a little scary. Could it be simplified with a regex? I unde
See my comment above. Which way should we try out first?
Line 112: /// Check wether this hint equals to a given string, ignoring case.
> typo: whether
Done
Line 113: public boolean is(String s) { return hintName_.equals(s.toLowerCase()); }
> equalsIgnoreCase
I've used toLowerCase during PlanHint creation, hoping that storing all hints and args in lower case by convention would make the code easier to reason about. Especially comparing the hintArgs_ list to that of another PlanHint becomes easier since we can use hintArgs_.equals(). Should I lift that restriction?
I also added comments to the member variables explaining that we store them in lowercase.
http://gerrit.cloudera.org:8080/#/c/5051/1/fe/src/main/java/org/apache/impala/planner/Planner.java
File fe/src/main/java/org/apache/impala/planner/Planner.java:
Line 495: * Insert a sort node on top of the plan, depending on the clustered/noclustered plan
> update comment
Done
http://gerrit.cloudera.org:8080/#/c/5051/1/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
File fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java:
Line 1723: public void TestInsertHints() throws AnalysisException {
> don't we test the clustered hint here?
We hadn't so far. I added them to the change for IMPALA-2523 and will eventually rebase this one.
Line 1777: prefix, suffix), "Could not find SORTBY hint column foo in table.");
> in target table
Done
Line 1782: "SORTBY hint column list must not contain Hdfs partition columns.");
> mention the offending column name
Done
Line 1786: "SORTBY hint column list must not contain Kudu primary key columns.");
> mention the offending column
Done
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Marcel Kornacker (Code Review)" <ge...@cloudera.org>.
Marcel Kornacker has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 5: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Marcel Kornacker (Code Review)" <ge...@cloudera.org>.
Marcel Kornacker has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 8: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 8
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dh...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Hello Marcel Kornacker, Dan Hecht,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/5051
to look at the new patch set (#7).
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
IMPALA-4163: Add sortby() query hint
This change introduces the sortby() query plan hint for insert
statements. When specified, sortby(a, b) will add an additional sort
step to the plan to order data by columns a, b before inserting it into
the target table.
Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
---
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
A fe/src/main/java/org/apache/impala/analysis/PlanHint.java
M fe/src/main/java/org/apache/impala/analysis/SelectList.java
M fe/src/main/java/org/apache/impala/analysis/TableRef.java
M fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
M fe/src/main/java/org/apache/impala/planner/Planner.java
M fe/src/main/jflex/sql-scanner.flex
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java
M testdata/workloads/functional-planner/queries/PlannerTest/insert.test
M testdata/workloads/functional-query/queries/QueryTest/insert.test
13 files changed, 498 insertions(+), 149 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/51/5051/7
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 7
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dh...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Dan Hecht (Code Review)" <ge...@cloudera.org>.
Dan Hecht has posted comments on this change.
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
Patch Set 7: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 7
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dh...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-4163: Add sortby() query hint
Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Hello Marcel Kornacker, Internal Jenkins, Dan Hecht,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/5051
to look at the new patch set (#8).
Change subject: IMPALA-4163: Add sortby() query hint
......................................................................
IMPALA-4163: Add sortby() query hint
This change introduces the sortby() query plan hint for insert
statements. When specified, sortby(a, b) will add an additional sort
step to the plan to order data by columns a, b before inserting it into
the target table.
Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
---
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
A fe/src/main/java/org/apache/impala/analysis/PlanHint.java
M fe/src/main/java/org/apache/impala/analysis/SelectList.java
M fe/src/main/java/org/apache/impala/analysis/TableRef.java
M fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
M fe/src/main/java/org/apache/impala/planner/Planner.java
M fe/src/main/jflex/sql-scanner.flex
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java
M testdata/workloads/functional-planner/queries/PlannerTest/insert.test
M testdata/workloads/functional-query/queries/QueryTest/insert.test
13 files changed, 490 insertions(+), 140 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/51/5051/8
--
To view, visit http://gerrit.cloudera.org:8080/5051
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I37a3ffab99aaa5d5a4fd1ac674b3e8b394a3c4c0
Gerrit-PatchSet: 8
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dh...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>