You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2015/08/25 06:26:45 UTC

[jira] [Commented] (PHOENIX-2206) Math function called with PK column ignores WHERE clause

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

James Taylor commented on PHOENIX-2206:
---------------------------------------

Looks like an issue with our new Math built-in functions: CBRT, EXP, LN, SQRT, and LOG. It occurs when the column argument is a leading column in the PK constraint. [~shuxi0ng] - it'd be good to have unit tests that cover the above.

We'll come up with a fix for the next patch release, but one workaround for now is to use a noop expression in place of the column reference, for example add zero to it:
{code}
select ID, exp(ID) from test where exp(ID+0) < 10 ;
{code}

> Math function called with PK column ignores WHERE clause
> --------------------------------------------------------
>
>                 Key: PHOENIX-2206
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2206
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.5.0
>            Reporter: ckran
>            Priority: Minor
>              Labels: exp, filter
>
> A WHERE condition that uses a scalar function such as EXP is ignored and all rows are returned. 
> create table test (id integer primary key) ;
> upsert into test values (1) ;
> upsert into test values (2) ;
> upsert into test values (3) ;
> upsert into test values (4) ;
> upsert into test values (5) ;
> select ID, exp(ID) from test where exp(ID) < 10 ;
> Result is:
> 1 2.718281828459045
> 2 7.38905609893065
> 3 20.085536923187668
> 4 54.598150033144236
> 5 148.4131591025766



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