Taras Bobrovytsky has submitted this change and it was merged.

Change subject: IMPALA-4142: qgen: Hive does not support CTEs inside sub-query 
blocks
......................................................................


IMPALA-4142: qgen: Hive does not support CTEs inside sub-query blocks

Changes:

Hive does not support WITH clauses inside sub-query blocks, the DefaultProfile 
actually
already has an option to disable this called "use_nested_with" and the 
HiveProfile
returns False for this method. However, there is a bug in the usage of 
"use_nested_with";
it is not checked every time a sub-query is created. Specifically, it is not 
checked when
an in-line view is created, or when the query within a WITH clause is created 
(so it's
possible to create WITH ... AS (WITH ...)). This patch fixes both of these 
issues since
Hive throws a SQL compile exception for either case.

Testing:

* Added new unit tests
* All unit tests pass
* Tested locally against Hive
* Tested against Impala via Leopard
* Tested against Impala via the discrepancy checker

Change-Id: Ie585bbbd88a32f502457a4ca9f2f54c7e1ade354
Reviewed-on: http://gerrit.cloudera.org:8080/4534
Reviewed-by: Taras Bobrovytsky <tbobrovyt...@cloudera.com>
Tested-by: Taras Bobrovytsky <tbobrovyt...@cloudera.com>
---
M tests/comparison/query_generator.py
A tests/comparison/tests/test_use_nested_with.py
2 files changed, 72 insertions(+), 2 deletions(-)

Approvals:
  Taras Bobrovytsky: Looks good to me, approved; Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/4534
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie585bbbd88a32f502457a4ca9f2f54c7e1ade354
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Sahil Takiar <stak...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Taras Bobrovytsky <tbobrovyt...@cloudera.com>

Reply via email to