You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Quanlong Huang (Jira)" <ji...@apache.org> on 2021/02/06 08:49:00 UTC
[jira] [Commented] (IMPALA-10482) Select-star query on unrelative
collection column of transactional table hits IllegalStateException
[ https://issues.apache.org/jira/browse/IMPALA-10482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17280125#comment-17280125 ]
Quanlong Huang commented on IMPALA-10482:
-----------------------------------------
The AcidRewriter will rewrite queries like "{{select item from my_complex_orc.int_array}}" to
"{{select item from my_complex_orc t, t.int_array}}"
This cause troubles in star expansion. Because the origin query "{{select * from my_complex_orc.int_array}}" is analyzed as
"{{select item from my_complex_orc.int_array}}"
But the rewritten query "{{select * from my_complex_orc t, t.int_array}}" is analyzed as
"{{select id, item from my_complex_orc t, t.int_array}}"
So finally we hit Preconditions.checkState asserting the resultsExprs should match the origResultTypes.
{code:java}
public void castResultExprs(List<Type> types) throws AnalysisException {
List<Expr> resultExprs = getResultExprs();
Preconditions.checkNotNull(resultExprs);
Preconditions.checkState(resultExprs.size() == types.size()); // <---- Hit here
for (int i = 0; i < types.size(); ++i) {
if (!resultExprs.get(i).getType().equals(types.get(i))) {
resultExprs.set(i, resultExprs.get(i).castTo(types.get(i)));
}
}
}
{code}
> Select-star query on unrelative collection column of transactional table hits IllegalStateException
> ---------------------------------------------------------------------------------------------------
>
> Key: IMPALA-10482
> URL: https://issues.apache.org/jira/browse/IMPALA-10482
> Project: IMPALA
> Issue Type: Bug
> Components: Frontend
> Affects Versions: Impala 4.0
> Reporter: Quanlong Huang
> Priority: Critical
>
> {{SELECT *}} query on unrelative collection column of transactional ORC table will hit IllegalStateException.
> Reproduce the bug by:
> {code:sql}
> create table my_complex_orc (id int, int_array array<int>) stored as orc tblproperties('transactional'='true');
> select * from my_complex_orc.int_array;
> {code}
> FE stacktrace:
> {code:java}
> I0206 16:04:42.212499 15294 Frontend.java:1587] 7e42f06526f5791a:e18eb18e00000000] Analyzing query: select * from my_complex_orc.int_array db: default
> I0206 16:04:42.213887 15294 jni-util.cc:288] 7e42f06526f5791a:e18eb18e00000000] java.lang.IllegalStateException
> at com.google.common.base.Preconditions.checkState(Preconditions.java:492)
> at org.apache.impala.analysis.StatementBase.castResultExprs(StatementBase.java:114)
> at org.apache.impala.analysis.AnalysisContext.analyze(AnalysisContext.java:561)
> at org.apache.impala.analysis.AnalysisContext.analyzeAndAuthorize(AnalysisContext.java:445)
> at org.apache.impala.service.Frontend.doCreateExecRequest(Frontend.java:1627)
> at org.apache.impala.service.Frontend.getTExecRequest(Frontend.java:1594)
> at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1564)
> at org.apache.impala.service.JniFrontend.createExecRequest(JniFrontend.java:159)
> {code}
> cc [~boroknagyz]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org