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

Lars Hofhansl edited comment on PHOENIX-6400 at 3/3/21, 7:09 AM:
-----------------------------------------------------------------

This is not a fundamental issue, it just needs to be implemented. As it looks 
now, filters are evaluated before we merge in the non-covered columns. Fixing 
this for real - i.e. merge in non-covered columns and then run the filters is 
major surgery, as the filters are run by HBase during the local index scan.

So I will bring back the restriction that local indexes will not be used if 
there's an uncovered column anywhere in the WHERE clause. Uncovered columns in 
the SELECT part are still OK, though. Shame!


was (Author: lhofhansl):
This is not a fundamental issue, it just needs to be implemented. As it looks 
now, filters are evaluated before we merge in the non-covered columns. Fixing 
this for real - i.e. merge in non-covered columns and then run the filters is 
major surgery.

So I will bring back the restriction that local indexes will not be used if 
there's an uncovered column anywhere in the WHERE clause. Uncovered columns in 
the SELECT part are still OK, though. Shame!

> Local index query returns incorrect values with other columns in the WHERE 
> clause
> ---------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6400
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6400
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Lars Hofhansl
>            Priority: Blocker
>             Fix For: 5.1.1, 4.16.1
>
>         Attachments: 6400-5.1.txt, 6400-test-5.1.txt
>
>
> {code}
> > create table test(pk1 integer not null primary key, v1 float, v2 float, v3 
> > float);
> > create local index L1 on test (v1);
> > upsert into test values(1000, 0.01, 0.1, 0.5);
> > select * from test where v1 < 0.1;
> +------+------+-----+-----+
> | PK1  |  V1  | V2  | V3  |
> +------+------+-----+-----+
> | 1000 | 0.01 | 0.1 | 0.5 |
> +------+------+-----+-----+
> > select * from test where v1 < 0.1 and v2 < 10.0;
> +-----+----+----+----+
> | PK1 | V1 | V2 | V3 |
> +-----+----+----+----+
> > select /*+ NO_INDEX */ * from test where v1 < 0.1 and v2 < 10.0;
> +------+------+-----+-----+
> | PK1  |  V1  | V2  | V3  |
> +------+------+-----+-----+
> | 1000 | 0.01 | 0.1 | 0.5 |
> +------+------+-----+-----+
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to