[ 
https://issues.apache.org/jira/browse/HBASE-30586?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

mazhengxuan updated HBASE-30586:
--------------------------------
    Description: 
With row-key pushdown enabled, an {{AND}} between two predicates can lose keys 
when each side combines a range and a point lookup.

To reproduce, insert two rows with string keys {{row002}} and {{{}row010{}}}, 
each with at least one cell. Read the table through the Spark 4 datasource and 
run:

```bash

SELECT key FROM t
WHERE (key < 'row004' OR key = 'row010')
AND (key > 'row008' OR key = 'row002')

```

*Expected:* Both rows. {{row002}} matches the range on the left and the point 
on the right. {{row010}} matches the point on the left and the range on the 
right.

*Actual:* The query returns no rows.

{{RowKeyFilter.mergeIntersect}} needs to keep points from either side that fall 
within a range on the other side. I’d add the query above as a regression test 
and repeat it with the two sides of the {{AND}} swapped. HBASE-30509 covered 
duplicate reads in a union; this case loses rows in an intersection.

  was:
With row-key pushdown enabled, an {{AND}} between two predicates can lose keys 
when each side combines a range and a point lookup.

To reproduce, insert two rows with string keys {{row002}} and {{{}row010{}}}, 
each with at least one cell. Read the table through the Spark 4 datasource and 
run:

{{SELECT key FROM t
WHERE (key < 'row004' OR key = 'row010')
  AND (key > 'row008' OR key = 'row002')}}

*Expected:* Both rows. {{row002}} matches the range on the left and the point 
on the right. {{row010}} matches the point on the left and the range on the 
right.

*Actual:* The query returns no rows.

{{RowKeyFilter.mergeIntersect}} needs to keep points from either side that fall 
within a range on the other side. I’d add the query above as a regression test 
and repeat it with the two sides of the {{AND}} swapped. HBASE-30509 covered 
duplicate reads in a union; this case loses rows in an intersection.


> Preserve matching row keys when intersecting point lookups and scan ranges
> --------------------------------------------------------------------------
>
>                 Key: HBASE-30586
>                 URL: https://issues.apache.org/jira/browse/HBASE-30586
>             Project: HBase
>          Issue Type: Sub-task
>          Components: hbase-connectors
>            Reporter: mazhengxuan
>            Assignee: mazhengxuan
>            Priority: Major
>
> With row-key pushdown enabled, an {{AND}} between two predicates can lose 
> keys when each side combines a range and a point lookup.
> To reproduce, insert two rows with string keys {{row002}} and {{{}row010{}}}, 
> each with at least one cell. Read the table through the Spark 4 datasource 
> and run:
> ```bash
> SELECT key FROM t
> WHERE (key < 'row004' OR key = 'row010')
> AND (key > 'row008' OR key = 'row002')
> ```
> *Expected:* Both rows. {{row002}} matches the range on the left and the point 
> on the right. {{row010}} matches the point on the left and the range on the 
> right.
> *Actual:* The query returns no rows.
> {{RowKeyFilter.mergeIntersect}} needs to keep points from either side that 
> fall within a range on the other side. I’d add the query above as a 
> regression test and repeat it with the two sides of the {{AND}} swapped. 
> HBASE-30509 covered duplicate reads in a union; this case loses rows in an 
> intersection.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to