You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Tanuj Khurana (Jira)" <ji...@apache.org> on 2025/03/12 05:40:00 UTC
[jira] [Created] (PHOENIX-7543) Wrong result returned when query is served by index and some columns are null
Tanuj Khurana created PHOENIX-7543:
--------------------------------------
Summary: Wrong result returned when query is served by index and some columns are null
Key: PHOENIX-7543
URL: https://issues.apache.org/jira/browse/PHOENIX-7543
Project: Phoenix
Issue Type: Bug
Affects Versions: 5.2.1, 5.1.3, 5.1.2, 5.2.0, 5.1.1, 5.1.0
Reporter: Tanuj Khurana
Assignee: Tanuj Khurana
Here is the repro
{code:java}
0: jdbc:phoenix:localhost> create table t1 (id varchar primary key, val1
bigint, val2 bigint);
0: jdbc:phoenix:localhost> create index idx on t1 (val1) include (val2);
0: jdbc:phoenix:localhost> upsert into t1 values ('a', 1, 2);
0: jdbc:phoenix:localhost> upsert into t1 values ('a', 1, null);
0: jdbc:phoenix:localhost> explain select count(*) from t1 where val1=1 and val2=2;
+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+
| PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS |
+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+
| CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER IDX [1] | null | null | null |
| SERVER FILTER BY "VAL2" = 2 | null | null | null |
| SERVER AGGREGATE INTO SINGLE ROW | null | null | null |
+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+
0: jdbc:phoenix:localhost> select count(*) from t1 where val1=1 and val2=2;
+------------------------------------------+
| COUNT(1) |
+------------------------------------------+
| 1 |
+------------------------------------------+
0: jdbc:phoenix:localhost> select * from t1 where val1=1 and val2=2;
+------------------------------------------+------------------------------------------+------------------------------------------+
| ID | VAL1 | VAL2 |
+------------------------------------------+------------------------------------------+------------------------------------------+
| a | 1 | null |
+------------------------------------------+------------------------------------------+------------------------------------------+
0: jdbc:phoenix:localhost>
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)