Riza Suminto has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/22546


Change subject: IMPALA-13785: Skip rewriting expr of Hive auto-generated label
......................................................................

IMPALA-13785: Skip rewriting expr of Hive auto-generated label

IMPALA-10836 introduced the SimplifyCastExprRule optimization to
simplify CAST expressions. However, applying this rewrite rule over
expression referred by Hive auto-generated label has caused
AnalysisException like following:

AnalysisException: Could not resolve column/field reference:
'failing_view._c0'

It is most likely that, before IMPALA-10836, expression referred by Hive
auto-generated label never effectively being rewritten. Thus, the
ExprSubstitutionMap across multiple InlineViewRef was intact.

This patch attempt to fix the issue by making any expression in
SelectList that mapped to Hive auto-generated label ineligible for any
kind of expression rewrite.

Testing:
- Add test case in views-compatibility.test.
- Break test_view_compatibility_hive into 3 separate tests.
- Refactor test_views_compatibility.py to run both EXPLAIN and SELECT
  query over the test view.
- Pass test_views_compatibility.py in exhaustive exploration.
- Pass core tests.

Change-Id: I4b8bbd0afd6da0532bf2ef460989d4f01337d198
---
M fe/src/main/java/org/apache/impala/analysis/SelectList.java
M fe/src/main/java/org/apache/impala/analysis/SelectListItem.java
M testdata/workloads/functional-query/queries/QueryTest/views-compatibility.test
M tests/metadata/test_views_compatibility.py
4 files changed, 108 insertions(+), 76 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/46/22546/1
--
To view, visit http://gerrit.cloudera.org:8080/22546
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b8bbd0afd6da0532bf2ef460989d4f01337d198
Gerrit-Change-Number: 22546
Gerrit-PatchSet: 1
Gerrit-Owner: Riza Suminto <[email protected]>

Reply via email to