My Oracle Support Banner

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


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(
    at com.cloudera.impala.service.Frontend.createExecRequest(
    at com.cloudera.impala.service.JniFrontend.createExecRequest(
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(
    at com.cloudera.impala.analysis.AggregateInfo.create(
    at com.cloudera.impala.analysis.SelectStmt.createAggInfo(
    at com.cloudera.impala.analysis.SelectStmt.analyzeAggregation(
    at com.cloudera.impala.analysis.SelectStmt.analyze(
    at com.cloudera.impala.analysis.AnalysisContext.analyze(
    ... 2 more




To view full details, sign in with your My Oracle Support account.

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

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.