of a couple
of columns.
When I try the following:-
select count(distinct a.col1, b.col2)
from table tab1 a
inner join tab2 b on b.joincol = a.joincol
where a.col3 = ‘some condition’
and b.col4 = ‘some other condition';
I get the following error:-
Error: ERROR 605 (42P00): Syntax error. Unknown
Michael,
You're correct, count distinct doesn't support multiple arguments currently
(I filed PHOENIX-2062 for this). Another workaround is to combine a.col1
and b.col2 into an expression, for example concatenating them. If order
matters, you could do this:
select count(distinct col1 || col2
the following:-
select count(distinct a.col1, b.col2)
from table tab1 a
inner join tab2 b on b.joincol = a.joincol
where a.col3 = ‘some condition’
and b.col4 = ‘some other condition';
I get the following error:-
Error: ERROR 605 (42P00): Syntax error. Unknown function:
DISTINCT_COUNT. (state
to Phoenix 4.2 on HDP 2.2)
I have a situation where I want to count the distinct combination of a
couple of columns.
When I try the following:-
select count(distinct a.col1, b.col2)
from table tab1 a
inner join tab2 b on b.joincol = a.joincol
where a.col3 = ‘some condition’
and b.col4
(or
workaround) as we need fast retrieval and proper counting?
We have the following environment:
Hbase 0.98.4.2.2.0.0
Phoenix: 4.2.0.2.2.0.0-2041
Core (CPU) - 8
RAM - 29 Gb
OS:centos6 (x86_64)
QUERY +++
SELECT A.COL1, A.COL2, COUNT(DISTINCT A.COL3), COUNT(DISTINCT A.COL4)
FROM
Phoenix: 4.2.0.2.2.0.0-2041
Core (CPU) - 8
RAM - 29 Gb
OS:centos6 (x86_64)
QUERY +++
SELECT A.COL1, A.COL2, COUNT(DISTINCT A.COL3), COUNT(DISTINCT A.COL4)
FROM A
WHERE A.COL5 = 1427864399000 AND A.COL5 = 1427947199000
GROUP BY A.COL1, A.COL2
HAVING COUNT
) as we need fast retrieval and proper counting?
We have the following environment:
Hbase 0.98.4.2.2.0.0
Phoenix: 4.2.0.2.2.0.0-2041
Core (CPU) - 8
RAM - 29 Gb
OS:centos6 (x86_64)
QUERY +++
SELECT A.COL1, A.COL2, COUNT(DISTINCT A.COL3), COUNT(DISTINCT A.COL4)
FROM A
WHERE