This article examples ONE of the possible causes for the issue that Impala query failed with IllegalStateException error. Recently I was dealing with an Impala issue that when runnnig a simple SELECT query against a table failed with IllegalStateException error:
SELECT * FROM ;
Query: SELECT * FROM 
ERROR: IllegalStateException: null
Checking the impala daemon log shows the following stacktrace:
I1114 17:13:04.425281 18380 jni-util.cc:177] java.lang.IllegalStateException
at com.google.common.base.Preconditions.checkState(Preconditions.java:129)
at com.cloudera.impala.analysis.SlotRef.getIdsHelper(SlotRef.java:206)
at com.cloudera.impala.analysis.Expr.getIds(Expr.java:887)
at com.cloudera.impala.analysis.Analyzer.materializeSlots(Analyzer.java:2063)
at com.cloudera.impala.planner.SingleNodePlanner.createSingleNodePlan(SingleNodePlanner.java:131)
at com.cloudera.impala.planner.Planner.createPlan(Planner.java:58)
at com.cloudera.impala.service.Frontend.createExecRequest(Frontend.java:897)
at com.cloudera.impala.service.JniFrontend.createExecRequest(JniFrontend.java:147)
Based on the issues I had seen in the past, most of the cause of the error was due to INVALID_TYPE for the table that Impala was trying to query. Check the DDL of the table in question by running the following query:
SHOW CREATE TABLE ;

[impala-damon-host:21000] > SHOW CREATE TABLE test;
Query: SHOW CREATE TABLE test
+---------------------------------+
| result                          |
+---------------------------------+
| CREATE EXTERNAL TABLE test (    |
| col1 INVALID_TYPE
.....
You can see that Impala complained about INVALID_TYPE for column “col1”. If you run the same query in beeline, you will get the correct output:
> SHOW CREATE TABLE test;
Query: SHOW CREATE TABLE test
+---------------------------------+
| result                          |
+---------------------------------+
| CREATE EXTERNAL TABLE test (    |
| col1 date
.....
This is because currently Impala still does not support “Date” data type, please refer to the following docs: Impala Data Types HiveQL Features not Available in Impala The only solution for now is to use “Timestamp” data type which is supported by Impala.

2 Comments

  1. shouvanik

    Thanks for the solution.
    But now, I am getting a different error.

    nvalid SEQFILE_VALUE_CLASS_NAME: ‘org.apache.hadoop.hbase.client.Result

    Do you know why this situation arises?

    1. Eric Lin

      Hi shouvanik,

      Sorry about the delay in response, I have missed your email update.

      Can you please share the Impala daemon log message regarding the error? I need more info to see what might be happening.

      Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *