-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HIVE-25856: Intermittent null ordering in plans of queries with GROUP…
… BY and LIMIT (Stamatis Zampetakis, reviewed by Krisztian Kasa) Remove singleton instantiation of HiveAggregateSortLimitRule, which binds the default null ordering behavior for every subsequent query. Before this change setting hive.default.nulls.last has no effect in the plan. It also means that if another test/user sets this property it will have an impact on every subsequent query. Closes #2932
- Loading branch information
Showing
4 changed files
with
50 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
ql/src/test/queries/clientpositive/cbo_AggregateSortLimitRule.q
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE TABLE person (id INTEGER, country STRING); | ||
SET hive.default.nulls.last=false; | ||
EXPLAIN CBO SELECT country, count(1) FROM person GROUP BY country LIMIT 5; | ||
SET hive.default.nulls.last=true; | ||
EXPLAIN CBO SELECT country, count(1) FROM person GROUP BY country LIMIT 5; |
36 changes: 36 additions & 0 deletions
36
ql/src/test/results/clientpositive/llap/cbo_AggregateSortLimitRule.q.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
PREHOOK: query: CREATE TABLE person (id INTEGER, country STRING) | ||
PREHOOK: type: CREATETABLE | ||
PREHOOK: Output: database:default | ||
PREHOOK: Output: default@person | ||
POSTHOOK: query: CREATE TABLE person (id INTEGER, country STRING) | ||
POSTHOOK: type: CREATETABLE | ||
POSTHOOK: Output: database:default | ||
POSTHOOK: Output: default@person | ||
PREHOOK: query: EXPLAIN CBO SELECT country, count(1) FROM person GROUP BY country LIMIT 5 | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@person | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: EXPLAIN CBO SELECT country, count(1) FROM person GROUP BY country LIMIT 5 | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@person | ||
#### A masked pattern was here #### | ||
CBO PLAN: | ||
HiveSortLimit(sort0=[$1], dir0=[ASC-nulls-first], fetch=[5]) | ||
HiveProject(country=[$0], $f1=[$1]) | ||
HiveAggregate(group=[{1}], agg#0=[count()]) | ||
HiveTableScan(table=[[default, person]], table:alias=[person]) | ||
|
||
PREHOOK: query: EXPLAIN CBO SELECT country, count(1) FROM person GROUP BY country LIMIT 5 | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@person | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: EXPLAIN CBO SELECT country, count(1) FROM person GROUP BY country LIMIT 5 | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@person | ||
#### A masked pattern was here #### | ||
CBO PLAN: | ||
HiveSortLimit(sort0=[$1], dir0=[ASC], fetch=[5]) | ||
HiveProject(country=[$0], $f1=[$1]) | ||
HiveAggregate(group=[{1}], agg#0=[count()]) | ||
HiveTableScan(table=[[default, person]], table:alias=[person]) | ||
|