You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "Lars Hofhansl (JIRA)" <ji...@apache.org> on 2018/10/16 16:43:00 UTC

[jira] [Commented] (PHOENIX-4976) Comparisson on RVC are still incorrect

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

Lars Hofhansl commented on PHOENIX-4976:
----------------------------------------

[~tdsilva]

> Comparisson on RVC are still incorrect
> --------------------------------------
>
>                 Key: PHOENIX-4976
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4976
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Lars Hofhansl
>            Priority: Major
>
> See PHOENIX-3383
> {code}
> create table test(k1 integer not null, k2 integer not null, k3 integer not null, v integer, constraint pk primary key (k1, k2 desc, k3));
> upsert into test values(1,1,1,2);
> upsert into test values(1,2,1,2);
> upsert into test values(1,3,1,2);
> upsert into test values(1,4,1,2);
> {code}
> {code}
> select * from test where (k1, k2, k3) = (1,2,1) order by k1, k2 desc, k3;
> +-----+-----+-----+----+
> | K1  | K2  | K3  | V  |
> +-----+-----+-----+----+
> | 1   | 2   | 1   | 2  |
> +-----+-----+-----+----+
> {code}
> {code}
> select * from test where (k1, k2, k3) > (1,2,1) order by k1, k2 desc, k3;
> +-----+-----+-----+----+
> | K1  | K2  | K3  | V  |
> +-----+-----+-----+----+
> | 1   | 4   | 1   | 2  |
> | 1   | 3   | 1   | 2  |
> | 1   | 2   | 1   | 2  |
> | 1   | 1   | 1   | 2  |
> +-----+-----+-----+----+
> {code}
> {code}
> select * from test where (k1, k2, k3) < (1,2,1) order by k1, k2 desc, k3;
> +-----+-----+-----+----+
> | K1  | K2  | K3  | V  |
> +-----+-----+-----+----+
> | 1   | 4   | 1   | 2  |
> | 1   | 3   | 1   | 2  |
> | 1   | 2   | 1   | 2  |
> | 1   | 1   | 1   | 2  |
> +-----+-----+-----+----+
> {code}
> Looks like in this case each > or < comparison will simply return all rows. This does not happen when the second key part is not descending.
> Edit: > and < return all rows with the same first key part (k1)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)