phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-1237) COALESCE Function - type of second parameter
Date Thu, 18 Sep 2014 08:02:33 GMT

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

ASF GitHub Bot commented on PHOENIX-1237:
-----------------------------------------

GitHub user tzolkincz opened a pull request:

    https://github.com/apache/phoenix/pull/17

    PHOENIX-1237

    https://issues.apache.org/jira/browse/PHOENIX-1237

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tzolkincz/phoenix master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/phoenix/pull/17.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17
    
----
commit 7ee1dd68b11099f8d94d267fd1cf57b95f5451d0
Author: Vaclav Loffelmann <vaclav.loffelmann@socialbakers.com>
Date:   2014-09-04T14:46:32Z

    PHOENIX-1237
    
    repair bug
    
    fix test ClientTimeArithmeticQueryIT.testCoalesceFunction
    
    Revert "fix test ClientTimeArithmeticQueryIT.testCoalesceFunction"
    
    This reverts commit bff9bc411235283025b83c02e6f03ae5498b1c84.
    
    update test
    
    update imports
    
    evaluating tru only if children was evaluated
    
    update coalesce input params validating
    
    drop table after test
    
    revert pom changes

----


> COALESCE Function - type of second parameter
> --------------------------------------------
>
>                 Key: PHOENIX-1237
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1237
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 3.1, 4.1
>            Reporter: Vaclav Loffelmann
>            Assignee: Vaclav Loffelmann
>         Attachments: PHOENIX-1237.fix.patch, PHOENIX-1237.fix2.patch, PHOENIX_1237.patch
>
>
> There is an issue with automatic set data type of second parameter to coalesce function.
> For instance table:
> {code:sql}
> CREATE TABLE IF NOT EXISTS TEST_COALESCE(
> ID BIGINT NOT NULL,
> COUNT UNSIGNED_INT
> CONSTRAINT pk PRIMARY KEY(ID));
> {code}
> and query:
> {code:sql}
> SELECT COALESCE(SUM(COUNT), 0) FROM TEST_SUM GROUP BY ID;
> {code}
> This will cause in:
> {quote}SQLException: ERROR 507 (42846): Cannot convert type. COALESCE expected UNSIGNED_INT,
but got INTEGER {quote}
> Hence second parameter is typed to its input value (eg. 0 is signed int not long), and
long is expected. That is cause for ArrayIndexOutOfBoundsException described in PHOENIX-1229.



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

Mime
View raw message