Github user JamesRTaylor commented on the pull request:

    https://github.com/apache/phoenix/pull/12#issuecomment-55555910
  
    No, don't use the intersect method - it's not what you want. You need to 
just run through both the region ranges and the guideposts together, adding 
ranges (always inclusive at the start and exclusive at the end which is the 
default) as you go. Both the guideposts and the region boundaries are sorted. 
You'll have an algorithm like this:
    ```
    currentPoint = currentRegion.startRange;
    while (more guideposts or regions) {
        while (currentGuidepost <= currentRegion.endRange) {
            add(new range from currentPoint to currentGuidepost);
            currentPoint = currentGuidepost;
            increment to next guidepost;
        }
        add(new range from currentPoint to currentRegion.endRange);
        increment to next region;
        currentPoint = currentRegion.startRange;
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to