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

ASF GitHub Bot commented on PHOENIX-7229:
-----------------------------------------

tkhurana commented on code in PR #1832:
URL: https://github.com/apache/phoenix/pull/1832#discussion_r1501295400


##########
phoenix-core-client/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java:
##########
@@ -941,12 +940,7 @@ private ScansWithRegionLocations getParallelScans(byte[] 
startKey, byte[] stopKe
             Scan scanFromContext = context.getScan();
             if (scanRanges.getPointLookupCount() == 1) {
                 // leverage bloom filter for single key point lookup by 
turning scan to Get Scan#isGetScan()
-                try {
-                    scanFromContext = new Scan(context.getScan());
-                } catch (IOException e) {
-                    throw new PhoenixIOException(e);
-                }
-                scanFromContext.withStopRow(scanFromContext.getStartRow(), 
scanFromContext.includeStartRow());
+                scanFromContext.withStopRow(scanFromContext.getStartRow(), 
true);

Review Comment:
   I actually didn't want to change the scan stored in StatementContext. I 
wanted to modify the scan we generate in getIterators.





> Leverage bloom filters for single key point lookups
> ---------------------------------------------------
>
>                 Key: PHOENIX-7229
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7229
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 5.1.3
>            Reporter: Tanuj Khurana
>            Assignee: Tanuj Khurana
>            Priority: Major
>
> PHOENIX-6710 enabled bloom filters by default when Phoenix tables are 
> created. However, we were not making use of it because Phoenix translates 
> point lookups to scans with the scan range [startkey, stopkey) where startkey 
> is inclusive and is equal to the row key and stopkey is exclusive and is the 
> next key after the row key. 
> This fails the check inside the hbase code in 
> [StoreFileReader#passesBloomFilter|https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileReader.java#L245-L250]
>  because it applies bloom filter only to scans which are gets and a scan is a 
> GET only if startkey = stopkey and both are inclusive. This is defined here 
> [Scan#isGetScan|https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java#L253-L255]
> We recently have some customers whose use case involves doing point lookups 
> where the row key is not going to be present in the table. Bloom filters are 
> ideal for those use cases.
> We can change our scan range for point lookups to leverage Bloom filters.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to