[
https://issues.apache.org/jira/browse/IMPALA-11021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17451570#comment-17451570
]
ASF subversion and git services commented on IMPALA-11021:
----------------------------------------------------------
Commit 6f80a1f16015b628a31548bdbecd61a554fc0d85 in impala's branch
refs/heads/master from skyyws
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=6f80a1f ]
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
Reviewed-on: http://gerrit.cloudera.org:8080/18040
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> Impala throw IllegalStateException when use predicate hint in query
> -------------------------------------------------------------------
>
> Key: IMPALA-11021
> URL: https://issues.apache.org/jira/browse/IMPALA-11021
> Project: IMPALA
> Issue Type: Bug
> Affects Versions: Impala 4.0.0
> Reporter: Sheng Wang
> Assignee: Sheng Wang
> Priority: Minor
>
> Hi [~stigahuang],[~amargoor], recently when I worked on IMPALA-7942, I found
> a bug when use predicate hint in query. Here is the query to reproduce this
> exception:
> {code:java}
> select * from tpch.lineitem where /* +ALWAYS_TRUE_TEST */ l_shipdate <=
> (select '1998-09-02') limit 10;
> {code}
> Here is the stack:
> {code:java}
> I1117 00:42:38.977468 23408 jni-util.cc:286]
> b14b98e13bd40747:07fc212b00000000] java.lang.IllegalStateException: Failed
> analysis after expr substitution.
> at org.apache.impala.analysis.Expr.substituteList(Expr.java:1118)
> at
> org.apache.impala.analysis.SelectStmt.materializeRequiredSlots(SelectStmt.java:1069)
> at
> org.apache.impala.planner.SingleNodePlanner.createSelectPlan(SingleNodePlanner.java:701)
> at
> org.apache.impala.planner.SingleNodePlanner.createQueryPlan(SingleNodePlanner.java:278)
> at
> org.apache.impala.planner.SingleNodePlanner.createSingleNodePlan(SingleNodePlanner.java:170)
> at
> org.apache.impala.planner.Planner.createPlanFragments(Planner.java:121)
> at org.apache.impala.planner.Planner.createPlans(Planner.java:248)
> at
> org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1543)
> at
> org.apache.impala.service.Frontend.getPlannedExecRequest(Frontend.java:1885)
> at
> org.apache.impala.service.Frontend.doCreateExecRequest(Frontend.java:1733)
> at
> org.apache.impala.service.Frontend.getTExecRequest(Frontend.java:1625)
> at
> org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1595)
> at
> org.apache.impala.service.JniFrontend.createExecRequest(JniFrontend.java:162)
> {code}
> I've already read the code, this is due to predicate analyze failed after
> clone, this code check failed:
> {code:java}
> Preconditions.checkState(!globalState_.warningsRetrieved)
> {code}
> I'm not sure if this bug already fixed on master branch. If not, I'd like to
> try this.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]