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

chenglei commented on PHOENIX-3578:
-----------------------------------

[~maryannxue], thank you very much for review , yes , It is true we cannot use 
skip scan if the scan is in reverse order,but we can use range scan if the scan 
is in reverse order,so the dynamic join filter should still be consided if the 
the scan is in reverse order,because the dynamic join filter may narrowing down 
the LHS reverse scan range.
I will modify my patch following your suggestion.

> 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)

Reply via email to