You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "Daniel Wong (Jira)" <ji...@apache.org> on 2022/03/16 23:29:00 UTC
[jira] [Comment Edited] (PHOENIX-6669) RVC returns a wrong result
[ https://issues.apache.org/jira/browse/PHOENIX-6669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17507901#comment-17507901 ]
Daniel Wong edited comment on PHOENIX-6669 at 3/16/22, 11:28 PM:
-----------------------------------------------------------------
The rewrite is not correct still. However, my main concern and why i mwntion this is without understanding exactly what the rvc is suppose to accomplish the test cases may not cover the set of issues or the code changes may be fragile. I do agree the wrong result is the critical issue of course but eant us implementing the full fix.
was (Author: dbwong):
The rewrite is not correct still. However, my main concern anf why i mwntion this is without understanding exactly what the rvc is suppose to accomplish the test cases may not cover the set of issues or the code changes may be fragile.
> RVC returns a wrong result
> --------------------------
>
> Key: PHOENIX-6669
> URL: https://issues.apache.org/jira/browse/PHOENIX-6669
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.16.1
> Reporter: Xinyi Yan
> Priority: Major
>
> {code:java}
> CREATE TABLE IF NOT EXISTS DUMMY (
> PK1 VARCHAR NOT NULL,
> PK2 BIGINT NOT NULL,
> PK3 BIGINT NOT NULL,
> PK4 VARCHAR NOT NULL,
> COL1 BIGINT,
> COL2 INTEGER,
> COL3 VARCHAR,
> COL4 VARCHAR, CONSTRAINT PK PRIMARY KEY
> (
> PK1,
> PK2,
> PK3,
> PK4
> )
> );UPSERT INTO DUMMY (PK1, PK4, COL1, PK2, COL2, PK3, COL3, COL4)
> VALUES ('xx', 'xid1', 0, 7, 7, 7, 'INSERT', null);
> {code}
> The non-RVC query returns no row, but the RVC query returns a wrong result.
> {code:java}
> 0: jdbc:phoenix:localhost> select PK2
> . . . . . . . . . . . . .> from DUMMY
> . . . . . . . . . . . . .> where PK1 ='xx'
> . . . . . . . . . . . . .> and (PK1 > 'xx' AND PK1 <= 'xx')
> . . . . . . . . . . . . .> and (PK2 > 5 AND PK2 <=5)
> . . . . . . . . . . . . .> and (PK3 > 2 AND PK3 <=2);
> +------------------------------------------+
> | PK2 |
> +------------------------------------------+
> +------------------------------------------+
> No rows selected (0.022 seconds)
> 0: jdbc:phoenix:localhost> select PK2
> . . . . . . . . . . . . .> from DUMMY
> . . . . . . . . . . . . .> where (PK1 = 'xx')
> . . . . . . . . . . . . .> and (PK1, PK2, PK3) > ('xx', 5, 2)
> . . . . . . . . . . . . .> and (PK1, PK2, PK3) <= ('xx', 5, 2);
> +------------------------------------------+
> | PK2 |
> +------------------------------------------+
> | 7 |
> +------------------------------------------+
> 1 row selected (0.033 seconds) {code}
> {code:java}
> 0: jdbc:phoenix:localhost> EXPLAIN select PK2 from DUMMY where (PK1 = 'xx') and (PK1, PK2, PK3) > ('xx', 5, 2) and (PK1, PK2, PK3) <= ('xx', 5, 2);
> +------------------------------------------+------------------------------------------+------------------------------------------+--+
> | PLAN | EST_BYTES_READ | EST_ROWS_READ | |
> +------------------------------------------+------------------------------------------+------------------------------------------+--+
> | CLIENT 1-CHUNK PARALLEL 1-WAY ROUND ROBIN RANGE SCAN OVER DUMMY ['xx'] | null | null |
> | SERVER FILTER BY FIRST KEY ONLY | null | null | |
> +------------------------------------------+------------------------------------------+------------------------------------------+--+
> 2 rows selected (0.024 seconds)
> 0: jdbc:phoenix:localhost> explain select PK2 from DUMMY where PK1 ='xx' and (PK1 > 'xx' AND PK1 <= 'xx') and (PK2 > 5 AND PK2 <=5) and (PK3 > 2 AND PK3 <=2);
> +------------------------------------------+------------------------------------------+------------------------------------------+--+
> | PLAN | EST_BYTES_READ | EST_ROWS_READ | |
> +------------------------------------------+------------------------------------------+------------------------------------------+--+
> | DEGENERATE SCAN OVER DUMMY | null | null | |
> +------------------------------------------+------------------------------------------+------------------------------------------+--+
> 1 row selected (0.015 seconds){code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)