[
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: [email protected]
For additional commands, e-mail: [email protected]