[
https://issues.jboss.org/browse/TEIID-3743?page=com.atlassian.jira.plugin...
]
Scott Wallace commented on TEIID-3743:
--------------------------------------
Error from Designer running a query with two count distincts:
{noformat}
org.teiid.runtime.client.TeiidClientException: java.lang.RuntimeException: Remote
org.teiid.core.TeiidProcessingException: TEIID30504
vw_impression_click_transaction_process_date_detail: 500051 TEIID11008:TEIID11004 Error
executing statement(s): [Prepared Values: [] SQL: SELECT g_0.process_date_key,
SUM(g_0.num_clicks), SUM(g_0.num_impressions), COUNT(DISTINCT g_0.orderid), COUNT(DISTINCT
g_0.`hash_tid`), SUM(g_0.sales) FROM
detail.vw_impression_click_transaction_process_date_detail g_0 WHERE g_0.process_date_key
>= '2016-05-22' AND g_0.process_date_key < '2016-05-23' AND
g_0.advertiser_key = 2149 GROUP BY g_0.process_date_key]
{noformat}
Multiple Count Distinct Columns Fails for Impala
------------------------------------------------
Key: TEIID-3743
URL:
https://issues.jboss.org/browse/TEIID-3743
Project: Teiid
Issue Type: Bug
Components: Misc. Connectors
Affects Versions: 8.11.4
Reporter: Scott Wallace
Assignee: Steven Hawkins
Fix For: 8.12
Teiid Impala translator incorrectly allows multiple count distinct columns, which fails
to execute since it is not supported by Impala.
Per Cloudera documentation:
{quote}By default, Impala only allows a single COUNT(DISTINCT columns) expression in each
query.
To produce the same result as multiple COUNT(DISTINCT) expressions, you can use the
following technique for queries involving a single table:
select v1.c1 result1, v2.c1 result2 from (select count(distinct col1) as c1 from t1) v1
cross join (select count(distinct col2) as c1 from t1) v2;{quote}
The Teiid-Impala translator should ideally rewrite the query as necessary so that the
query does not fail executing multiple count distincts against Impala.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)