phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Taylor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-3578) Incorrect query results when applying inner join and orderby desc
Date Wed, 22 Feb 2017 07:41:44 GMT

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

James Taylor commented on PHOENIX-3578:
---------------------------------------

[~comnetwork] - would be great if you could implement skip scan when scan is running in reverse
(PHOENIX-1193) so we could still optimize this in all cases.

> Incorrect query results when applying inner join and orderby desc
> -----------------------------------------------------------------
>
>                 Key: PHOENIX-3578
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3578
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.8.0, 4.9.0
>         Environment: hbase-1.1.2
>            Reporter: sungmin.cho
>         Attachments: PHOENIX-3578_v1.patch
>
>
> Step to reproduce:
> h4. 1. Create two tables
> {noformat}
> CREATE TABLE IF NOT EXISTS master (
>   id integer not null,
>   col1 varchar,
>   constraint pk_master primary key(id)
> );
> CREATE TABLE IF NOT EXISTS detail (
>   id integer not null,
>   seq integer not null,
>   col2 varchar,
>   constraint pk_master primary key(id, seq)
> );
> {noformat}
> h4. 2. Upsert values
> {noformat}
> upsert into master values(1, 'A1');
> upsert into master values(2, 'A2');
> upsert into master values(3, 'A3');
> upsert into detail values(1, 1, 'B1');
> upsert into detail values(1, 2, 'B2');
> upsert into detail values(2, 1, 'B1');
> upsert into detail values(2, 2, 'B2');
> upsert into detail values(3, 1, 'B1');
> upsert into detail values(3, 2, 'B2');
> upsert into detail values(3, 3, 'B3');
> {noformat}
> h4. 3. Execute query
> {noformat}
> select m.id, m.col1, d.seq, d.col2
> from master m, detail d
> where m.id = d.id
>   and d.id between 1 and 2
> order by m.id desc
> {noformat}
> h4. (/) Expected result
> {noformat}
> +-------+---------+--------+---------+
> | M.ID  | M.COL1  | D.SEQ  | D.COL2  |
> +-------+---------+--------+---------+
> | 2     | A2      | 1      | B1      |
> | 2     | A2      | 2      | B2      |
> | 1     | A1      | 1      | B1      |
> | 1     | A1      | 2      | B2      |
> +-------+---------+--------+---------+
> {noformat}
> h4. (!) Incorrect result
> {noformat}
> +-------+---------+--------+---------+
> | M.ID  | M.COL1  | D.SEQ  | D.COL2  |
> +-------+---------+--------+---------+
> | 1     | A1      | 1      | B1      |
> | 1     | A1      | 2      | B2      |
> +-------+---------+--------+---------+
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message