You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Jonathan Leech (JIRA)" <ji...@apache.org> on 2016/09/02 18:47:21 UTC

[jira] [Commented] (PHOENIX-1716) queries with to_char() return incorrect results

    [ https://issues.apache.org/jira/browse/PHOENIX-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15459276#comment-15459276 ] 

Jonathan Leech commented on PHOENIX-1716:
-----------------------------------------

this no longer seems to be an issue in 4.7. Was probably fixed somewhere between 4.3 and 4.7 along with another bug.

> queries with to_char() return incorrect results
> -----------------------------------------------
>
>                 Key: PHOENIX-1716
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1716
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Jonathan Leech
>              Labels: verify
>             Fix For: 4.9.0
>
>
> Using to_char() in a nested query causes it to get confused and return the value of the first column twice. 
> Example:
> select 
>  to_char(case when foo < 0 then 18446744073709551616.0 + foo else foo end, '0') foo,
>  to_char(case when bar < 0 then 18446744073709551616.0 + bar else bar end, '0') bar
> from (
> select cast(12345 as bigint) foo, cast(233456 as bigint) bar  from system."SEQUENCE" limit 1
> );
> Workarounds: Use different but equivalent format strings in each column, make subtle changes to the beginning of the columns; e.g. change to 0 + case when..., 0.0 + case when....



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