phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jay wong (JIRA)" <j...@apache.org>
Subject [jira] [Created] (PHOENIX-1027) Why position be reset in SkipScanFilter
Date Fri, 06 Jun 2014 09:05:01 GMT
jay wong created PHOENIX-1027:
---------------------------------

             Summary: Why position be reset in SkipScanFilter
                 Key: PHOENIX-1027
                 URL: https://issues.apache.org/jira/browse/PHOENIX-1027
             Project: Phoenix
          Issue Type: Bug
            Reporter: jay wong


the method in SkipScanFilter.java
{code}
 private int nextPosition(int i) {
        while (i >= 0 && slots.get(i).get(position[i]).isSingleKey() &&
(position[i] = (position[i] + 1) % slots.get(i).size()) == 0) {
            i--;
        }
        return i;
    }
{code}

In a query case. position[] has two elements position[0] = 3, position[1] = 0. 
and slots.get(i).size() = 1. 

after the mothod execute two element in position[] are all 0.

then

{code}
 private boolean intersect(byte[] lowerInclusiveKey, byte[] upperExclusiveKey, List<List<KeyRange>>
newSlots) {
........
 for (int i = 0; i <= lastSlot; i++) {
            List<KeyRange> newRanges = slots.get(i).subList(lowerPosition[i], Math.min(position[i]
+ 1, slots.get(i).size()));
            .....
        }
        return true;
    }
{code}

lowerPosition[i] = 3, Math.min(position[i] + 1, 
slots.get(i).size()) = 0 as a result of position[i] = 0

so:

{code}
java.lang.IndexOutOfBoundsException: end index (1) must not be less than start index (3)

at com.google.common.base.Preconditions.checkPositionIndexes(Preconditions.java:384)

at com.google.common.collect.RegularImmutableList.subList(RegularImmutableList.java:118)

at com.google.common.collect.RegularImmutableList.subList(RegularImmutableList.java:31)

at org.apache.phoenix.filter.SkipScanFilter.intersect(SkipScanFilter.java:221)

at org.apache.phoenix.filter.SkipScanFilter.hasIntersect(SkipScanFilter.java:121)

at org.apache.phoenix.compile.ScanRanges.intersect(ScanRanges.java:251)

at org.apache.phoenix.iterate.SkipRangeParallelIteratorRegionSplitter$1.apply(SkipRangeParallelIteratorRegionSplitter.java:84)

at org.apache.phoenix.iterate.SkipRangeParallelIteratorRegionSplitter$1.apply(SkipRangeParallelIteratorRegionSplitter.java:65)

at com.google.common.collect.Iterators$7.computeNext(Iterators.java:649)

at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)

at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)

at com.google.common.collect.Lists.newArrayList(Lists.java:138)

at com.google.common.collect.Lists.newArrayList(Lists.java:119)

at org.apache.phoenix.iterate.SkipRangeParallelIteratorRegionSplitter.filterRegions(SkipRangeParallelIteratorRegionSplitter.java:93)

at org.apache.phoenix.iterate.SkipRangeParallelIteratorRegionSplitter.getAllRegions(SkipRangeParallelIteratorRegionSplitter.java:54)

at org.apache.phoenix.iterate.DefaultParallelIteratorRegionSplitter.getSplits(DefaultParallelIteratorRegionSplitter.java:244)

at org.apache.phoenix.iterate.ParallelIterators.getSplits(ParallelIterators.java:205)

at org.apache.phoenix.iterate.ParallelIterators.<init>(ParallelIterators.java:78)

at org.apache.phoenix.execute.AggregatePlan.newIterator(AggregatePlan.java:162)

at org.apache.phoenix.execute.BasicQueryPlan.iterator(BasicQueryPlan.java:144)

at org.apache.phoenix.execute.BasicQueryPlan.iterator(BasicQueryPlan.java:125)

at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:202)

at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:922)

at sqlline.SqlLine$Commands.execute(SqlLine.java:3673)

at sqlline.SqlLine$Commands.sql(SqlLine.java:3584)

at sqlline.SqlLine.dispatch(SqlLine.java:821)

at sqlline.SqlLine.begin(SqlLine.java:699)

at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:441)

at sqlline.SqlLine.main(SqlLine.java:424)
{code}





--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message