Cloudera Impala Connector throwing Error when using COUNT(DISTINCT) aggregate functions with multiple columns in Spotfire.

Cloudera Impala Connector throwing Error when using COUNT(DISTINCT) aggregate functions with multiple columns in Spotfire.

book

Article ID: KB0075877

calendar_today

Updated On:

Products Versions
Spotfire Analyst ALL

Description

Description:
Cloudera Impala Exception - DISTINCT aggregate functions need to have the same set of parameters as count(DISTINCT transaction.column_name); deviating function: count(DISTINCT transaction.Column_name)

Symptoms:
 If the same parameters are not set, you may see the following error.
 
"Error while executing a query in Impala: [HY000] : AnalysisException: all DISTINCT aggregate functions need to have the same set of parameters as count(DISTINCT transaction.Column_name_1); deviating function: count(DISTINCT transaction.column_name_2)".

Issue/Introduction

Cloudera Impala Connector throw an error when using COUNT(DISTINCT) aggregate functions with multiple columns in Spotfire.

Resolution

Option 1). Remove the multiple columns. 
 
Option 2). Use the SET statement  APPX_COUNT_DISTINCT which allows multiple COUNT(DISTINCT) operations within a single query.

"In Impala 2.0 and later, you can set query options directly through the JDBC and ODBC interfaces by using the SET statement. Formerly, SET was only available as command within the impala-shell interpreter."

Additional Information

https://impala.apache.org/docs/build/html/topics/impala_set.html#set