Tim Armstrong has uploaded a new patch set (#6). ( 
http://gerrit.cloudera.org:8080/16112 )

Change subject: IMPALA-9897: GROUPING SETS/CUBE/ROLLUP parsing and analysis
......................................................................

IMPALA-9897: GROUPING SETS parsing and analysis.

Supports a single ROLLUP, CUBE or GROUPING SETS clause in
GROUP BY.

This implements basic parsing and validation of the query,
then raises an AnalysisException to report that it is not
supported.

Also adds non-standard "WITH ROLLUP" and "WITH CUBE" syntax
that is supported by some other SQL dialects.

TODO:
* Handling of these clauses with subquery rewriting needs more scrutiny.
  E.g. this is a query that pushes GROUP BY into a subquery. Does the
  grouping set affect what grouping exprs are added to subquery?

  select g.int_col, count(*)
  from functional.alltypesagg g left outer join functional.alltypes a
  on g.id = a.id
  where g.int_col < 100 and g.tinyint_col <
    (select count(*)
       from functional.alltypes t
          where t.id = g.id and g.string_col = t.string_col and
          t.bool_col = true)
          group by rollup(g.int_col, g.string_col)
          having count(*) < 100;

Testing:
* Add Parser test.
* Add toSql() test.
* Added analysis tests to check that analysis accepts or rejects
  queries correctly.

TODO:
* Clean up temporary hacks.

Change-Id: I178e45de94d736630c97ae1ec4a92423cd74621f
---
M fe/src/main/cup/sql-parser.cup
A fe/src/main/java/org/apache/impala/analysis/GroupByClause.java
M fe/src/main/java/org/apache/impala/analysis/SelectStmt.java
M fe/src/main/java/org/apache/impala/analysis/StmtRewriter.java
M fe/src/main/java/org/apache/impala/common/RuntimeEnv.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/AnalyzerTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java
10 files changed, 676 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/12/16112/6
--
To view, visit http://gerrit.cloudera.org:8080/16112
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I178e45de94d736630c97ae1ec4a92423cd74621f
Gerrit-Change-Number: 16112
Gerrit-PatchSet: 6
Gerrit-Owner: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-Reviewer: Aman Sinha <amsi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Shant Hovsepian <sh...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>

Reply via email to