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

Jelena updated PHOENIX-2505:
----------------------------
    Description: 
If you are selecting more than 2 rows, and you have a Boolean and any number 
type, depending on the order in which you put them in the GROUP BY clause, you 
get the following error:

{noformat}Error during Execute
org.apache.phoenix.schema.TypeMismatchException: ERROR 203 (22005): Type 
mismatch. DECIMAL cannot be coerced to BOOLEAN
{noformat}

Some examples:

Order that throws error:

GROUP BY    NUMBER_TYPE,    BOOLEAN,     ANY_TYPE
GROUP BY    BOOLEAN,     NUMBER_TYPE,     ANY_TYPE
GROUP BY    BOOLEAN,     ANY_TYPE,     NUMBER_TYPE

Order that does not throw the error:

GROUP BY   NUMBER_TYPE,    ANY_TYPE,      BOOLEAN
GROUP BY   NON_NUMBER_TYPE,     BOOLEAN,    NUMBER_TYPE  ==> NOTE: there can be 
any number of NON_NUMBER_TYPE columns before the first one
GROUP BY   NON_BOOLEAN_TYPE,    NUMBER_TYPE,     BOOLEAN   ==> NOTE: there can 
be any number of NON_BOOLEAN_TYPE columns before the NUMBER_TYPE
 




  was:
If you are selecting more than 2 rows, and you have a Boolean and any number 
type, depending on the order in which you put them in the GROUP BY clause, you 
get the following error:

{noformat}Error during Execute
<pre>    org.apache.phoenix.schema.TypeMismatchException: ERROR 203 (22005): 
Type mismatch. DECIMAL cannot be coerced to BOOLEAN</pre></p>
</html>{noformat}

Some examples:

Order that throws error:

GROUP BY    NUMBER_TYPE,    BOOLEAN,     ANY_TYPE
GROUP BY    BOOLEAN,     NUMBER_TYPE,     ANY_TYPE
GROUP BY    BOOLEAN,     ANY_TYPE,     NUMBER_TYPE

Order that does not throw the error:

GROUP BY   NUMBER_TYPE,    ANY_TYPE,      BOOLEAN
GROUP BY   NON_NUMBER_TYPE,     BOOLEAN,    NUMBER_TYPE  ==> NOTE: there can be 
any number of NON_NUMBER_TYPE columns before the first one
GROUP BY   NON_BOOLEAN_TYPE,    NUMBER_TYPE,     BOOLEAN   ==> NOTE: there can 
be any number of NON_BOOLEAN_TYPE columns before the NUMBER_TYPE
 





> Unexpected error caused by GROUP BY
> -----------------------------------
>
>                 Key: PHOENIX-2505
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2505
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Jelena
>            Priority: Minor
>
> If you are selecting more than 2 rows, and you have a Boolean and any number 
> type, depending on the order in which you put them in the GROUP BY clause, 
> you get the following error:
> {noformat}Error during Execute
> org.apache.phoenix.schema.TypeMismatchException: ERROR 203 (22005): Type 
> mismatch. DECIMAL cannot be coerced to BOOLEAN
> {noformat}
> Some examples:
> Order that throws error:
> GROUP BY    NUMBER_TYPE,    BOOLEAN,     ANY_TYPE
> GROUP BY    BOOLEAN,     NUMBER_TYPE,     ANY_TYPE
> GROUP BY    BOOLEAN,     ANY_TYPE,     NUMBER_TYPE
> Order that does not throw the error:
> GROUP BY   NUMBER_TYPE,    ANY_TYPE,      BOOLEAN
> GROUP BY   NON_NUMBER_TYPE,     BOOLEAN,    NUMBER_TYPE  ==> NOTE: there can 
> be any number of NON_NUMBER_TYPE columns before the first one
> GROUP BY   NON_BOOLEAN_TYPE,    NUMBER_TYPE,     BOOLEAN   ==> NOTE: there 
> can be any number of NON_BOOLEAN_TYPE columns before the NUMBER_TYPE
>  



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

Reply via email to