[ 
https://issues.apache.org/jira/browse/PHOENIX-2064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dumindu Buddhika updated PHOENIX-2064:
--------------------------------------
    Attachment: PHOENIX-2064.patch

[~ram_krish], [~jamestaylor] I have taken a look at this issue. It seems in 
ArrayConstructorExpression evaluate method, same TrustedByteArrayOutputStream  
object is used for evaluating each row. So it appends the values from current 
row to values from previous rows thus creating an incorrect result. This solves 
the issue. Please take a look. 

> ARRAY constructor doesn't work when used in COUNT DISTINCT
> ----------------------------------------------------------
>
>                 Key: PHOENIX-2064
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2064
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: Dumindu Buddhika
>         Attachments: PHOENIX-2064.patch
>
>
> As a workaround for PHOENIX-2062, I tried the following query:
> {code}
> SELECT COUNT(DISTINCT ARRAY[a.col1, b.col2]) ...
> {code}
> However, this always returns the full number of rows which is wrong.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to