BinShi-SecularBird commented on a change in pull request #463: Phoenix stats 
Initial Commit
URL: https://github.com/apache/phoenix/pull/463#discussion_r265824494
 
 

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/compile/ScanRanges.java
 ##########
 @@ -694,4 +694,138 @@ public TimeRange getRowTimestampRange() {
         return rowTimestampRange;
     }
 
+    public List<KeyRange> getRowKeyRanges(){
+
+        //If its scanRanges are everything or nothing we short circuit and 
leave
+        //As schema is not filled in
+        if (this.equals(ScanRanges.EVERYTHING)) {
+            return Lists.newArrayList(KeyRange.EVERYTHING_RANGE);
+        }
+        if (this.equals(ScanRanges.NOTHING)) {
+            return Lists.newArrayList(KeyRange.EMPTY_RANGE);
+        }
+
+        List<KeyRange> queryRowKeyRanges = 
Lists.newArrayListWithExpectedSize(this.ranges.size());
+
+        //Point lookups are stored in the first range as a whole and already a 
rowkey
+        // see ScanRanges.getPointLookupKeyIterator
+        if (this.isPointLookup()) {
+            queryRowKeyRanges.addAll(this.getRanges().get(0));
+        } else {
+
+            //If scanRanges.ranges has no information then should be  in the 
scanRanges.scanRange
+            if (this.getRanges().size() == 0) {
+                queryRowKeyRanges.add(this.getScanRange());
+            } else { //We have a composite key need the row key from the 
combination
 
 Review comment:
   Could you add "else {" to a new line which is also in your change and seems 
to be standard coding style? Also could you move the comment "//We have a 
composite key need the row key from the combination" to a new line?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to