wangsheng has uploaded this change for review. ( 
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 key word. 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 this check and add new
test cases for predicate hints. This maybe lead to warnings added
but not displayed, I think this is ok, since warnings added later
is generated by substitute predicate, the original predicate is already
added displayed warnings when creating and initializing TExecRequest.

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, 35 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/40/18040/1
--
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: newchange
Gerrit-Change-Id: Id719bc4280c811456333eb4b4ec5bc9cb8bae128
Gerrit-Change-Number: 18040
Gerrit-PatchSet: 1
Gerrit-Owner: wangsheng <[email protected]>

Reply via email to