Multiple Count Distinct in Impala Select Statements Causes the Statment to Fail. (Doc ID 1938770.1)

Last updated on NOVEMBER 03, 2014

Applies to:

Big Data Appliance Integrated Software - Version 2.3.0 and later
Linux x86-64

Symptoms

Cannot issue multiple count(distinct) within an Impala query.

[impala:21000] > select count(distinct i_class_id), count(distinct i_brand_id) from item;
Query: select count(distinct i_class_id), count(distinct i_brand_id) from item
ERROR: com.cloudera.impala.common.AnalysisException: Analysis exception (in select count(distinct i_class_id), count(distinct i_brand_id) from item)
    at com.cloudera.impala.analysis.AnalysisContext.analyze(AnalysisContext.java:133)
    at com.cloudera.impala.service.Frontend.createExecRequest(Frontend.java:221)
    at com.cloudera.impala.service.JniFrontend.createExecRequest(JniFrontend.java:89)
Caused by: com.cloudera.impala.common.AnalysisException: all DISTINCT aggregate functions need to have the same set of parameters as COUNT(DISTINCT i_class_id); deviating function: COUNT(DISTINCT i_brand_id)
    at com.cloudera.impala.analysis.AggregateInfo.createDistinctAggInfo(AggregateInfo.java:196)
    at com.cloudera.impala.analysis.AggregateInfo.create(AggregateInfo.java:143)
    at com.cloudera.impala.analysis.SelectStmt.createAggInfo(SelectStmt.java:466)
    at com.cloudera.impala.analysis.SelectStmt.analyzeAggregation(SelectStmt.java:347)
    at com.cloudera.impala.analysis.SelectStmt.analyze(SelectStmt.java:155)
    at com.cloudera.impala.analysis.AnalysisContext.analyze(AnalysisContext.java:130)
    ... 2 more

 

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms