wangsheng has uploaded a new patch set (#2). ( 
http://gerrit.cloudera.org:8080/18040 )

Change subject: IMPALA-11021: Fix bug when query contains illegal predicate 
hints
......................................................................

IMPALA-11021: Fix bug when query contains illegal predicate hints

Currently Impala support predicate hint: ALWAYS_TRUE, we can use this
hint after where keyword. If we use illegal hints carelessly, query
will throw IllegalStateException which is not expected. Query should
return normal results with a warning instead of a exception. This is
due to the condition check in Analyzer.addWarning().
After create TExecRequest and initialize it, Impala will get warnings
from 'GlobalState.warnings', and 'GlobalState.warningsRetrieved' will
be set to 'true' then. But after this, Impala will substitute predicate
by clone(), and analyze new predicate in later phase. New predicate
analyze will add hint warning to 'GlobalState.warnings', but failed and
throw IllegalStateException due to 'globalState_.warningsRetrieved'
check failed which is expected as 'false'.
This check is added in IMPALA-4166, I removed original condition check
and added a new check to ensure that all warnings for new/substituted
predicates are already exists in 'globalState_.warnings'. And this will
also avoiding exception caused by illegal hints.

Testing:
- Added new fe tests in 'AnalyzeStmtsTest'

Change-Id: Id719bc4280c811456333eb4b4ec5bc9cb8bae128
---
M fe/src/main/java/org/apache/impala/analysis/Analyzer.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
2 files changed, 47 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/40/18040/2
--
To view, visit http://gerrit.cloudera.org:8080/18040
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id719bc4280c811456333eb4b4ec5bc9cb8bae128
Gerrit-Change-Number: 18040
Gerrit-PatchSet: 2
Gerrit-Owner: wangsheng <sky...@163.com>
Gerrit-Reviewer: Amogh Margoor <amarg...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <huangquanl...@gmail.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <borokna...@cloudera.com>

Reply via email to