Impala query failed with error "IllegalStateException"

0 votes
14 views
asked Aug 30, 2017 in Hadoop by admin (4,410 points)
SummaryA common cause in Impala for this exception is INVALID_TYPE for a column. Currently does not support "Date" type.

Symptoms

Run a simple SELECT query against a table failed with IllegalStateException error:

SELECT * FROM <table_name>;
Query: SELECT * FROM <table_name>
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)
Applies To

Impala

Cause

Based on the lists of cases we have dealt with in the past, most of the cause of the error is due to INVALID_TYPE for the table in question. Run the following query to check the table's DDL:

SHOW CREATE TABLE <table_name>;

And if you see the following message:

[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 check the same query on beeline, you will get the following output:

> SHOW CREATE TABLE test;
Query: SHOW CREATE TABLE test
+---------------------------------+
| result                          |
+---------------------------------+
| CREATE EXTERNAL TABLE test (    |
| col1 date
.....

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 above is applicable for CDH versions before 5.10.0, because as part of IMPALA-3812 the error message has been improved. Starting with CDH 5.10.0, the error message changed to:

ERROR: AnalysisException: Unsupported type 'DATE' in 'col1'.
Instructions

Need to use "Timestamp" data type which is supported in both Hive and Impala.

Please log in or register to answer this question.

...