Jenkins build is back to normal : Phoenix | 4.0 | Hadoop2 #175

2014-09-27 Thread Apache Jenkins Server
See 



Jenkins build is back to normal : Phoenix | Master | Hadoop1 #390

2014-09-27 Thread Apache Jenkins Server
See 



Apache-Phoenix | 3.0 | Hadoop1 | Build Successful

2014-09-27 Thread Apache Jenkins Server
3.0 branch build status Successful
Source repository https://git-wip-us.apache.org/repos/asf/phoenix.git

Last Successful Compiled Artifacts https://builds.apache.org/job/Phoenix-3.0-hadoop1/lastSuccessfulBuild/artifact/

Last Complete Test Report https://builds.apache.org/job/Phoenix-3.0-hadoop1/lastCompletedBuild/testReport/

Changes
[jtaylor] Revert memory change in pom



Apache-Phoenix | 4.0 | Hadoop1 | Build Successful

2014-09-27 Thread Apache Jenkins Server
4.0 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf/incubator-phoenix.git

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.0-hadoop1/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.0-hadoop1/lastCompletedBuild/testReport/

Changes
[jtaylor] Revert memory change in pom



git commit: Revert memory change in pom

2014-09-27 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master 0fba23f3a -> 92e120c5b


Revert memory change in pom


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/92e120c5
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/92e120c5
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/92e120c5

Branch: refs/heads/master
Commit: 92e120c5b3a82209973dbde3a62c1cb6fd1fe51b
Parents: 0fba23f
Author: James Taylor 
Authored: Sat Sep 27 02:13:32 2014 -0700
Committer: James Taylor 
Committed: Sat Sep 27 02:14:18 2014 -0700

--
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/92e120c5/pom.xml
--
diff --git a/pom.xml b/pom.xml
index fee9c5a..4c83363 100644
--- a/pom.xml
+++ b/pom.xml
@@ -250,7 +250,7 @@
  UTF-8
  ${numForkedIT}
  true
- -enableassertions -Xmx2250m -XX:MaxPermSize=128m 
-Djava.security.egd=file:/dev/./urandom
+ -enableassertions -Xmx2000m -XX:MaxPermSize=128m 
-Djava.security.egd=file:/dev/./urandom
  
${test.output.tofile}
  
${basedir}/src/it/java
  
org.apache.phoenix.end2end.ClientManagedTimeTest



git commit: Revert memory change in pom

2014-09-27 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.0 02d480477 -> 6fc5cbe16


Revert memory change in pom


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/6fc5cbe1
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/6fc5cbe1
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/6fc5cbe1

Branch: refs/heads/4.0
Commit: 6fc5cbe161437c1e50c08453fd285e0ec32663ba
Parents: 02d4804
Author: James Taylor 
Authored: Sat Sep 27 02:13:32 2014 -0700
Committer: James Taylor 
Committed: Sat Sep 27 02:13:32 2014 -0700

--
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6fc5cbe1/pom.xml
--
diff --git a/pom.xml b/pom.xml
index fae2a5e..f9b9cad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -250,7 +250,7 @@
  UTF-8
  ${numForkedIT}
  true
- -enableassertions -Xmx2250m -XX:MaxPermSize=128m 
-Djava.security.egd=file:/dev/./urandom
+ -enableassertions -Xmx2000m -XX:MaxPermSize=128m 
-Djava.security.egd=file:/dev/./urandom
  
${test.output.tofile}
  
${basedir}/src/it/java
  
org.apache.phoenix.end2end.ClientManagedTimeTest



git commit: Revert memory change in pom

2014-09-27 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/3.0 5e48b32b4 -> 3aef8dbd8


Revert memory change in pom


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/3aef8dbd
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3aef8dbd
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3aef8dbd

Branch: refs/heads/3.0
Commit: 3aef8dbd8d268763d5efc75cc4584c65112263e4
Parents: 5e48b32
Author: James Taylor 
Authored: Sat Sep 27 02:13:00 2014 -0700
Committer: James Taylor 
Committed: Sat Sep 27 02:13:00 2014 -0700

--
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3aef8dbd/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 19bb1e0..9ff65d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -247,7 +247,7 @@
   UTF-8
   ${numForkedIT}
   true
-  -enableassertions -Xmx2250m -XX:MaxPermSize=128m 
-Djava.security.egd=file:/dev/./urandom
+  -enableassertions -Xmx2000m -XX:MaxPermSize=128m 
-Djava.security.egd=file:/dev/./urandom
   
${test.output.tofile}
   
${basedir}/src/it/java
   
org.apache.phoenix.end2end.HBaseManagedTimeTest



Build failed in Jenkins: Phoenix | 4.0 | Hadoop2 #174

2014-09-27 Thread Apache Jenkins Server
See 

Changes:

[jtaylor] PHOENIX-1298 Queries on fixed width type columns that have an index 
declared on them don't use that index

--
[...truncated 1479 lines...]
at 
org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.postScannerOpen(RegionCoprocessorHost.java:1845)
at 
org.apache.hadoop.hbase.regionserver.HRegionServer.scan(HRegionServer.java:3092)
at 
org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:29497)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2027)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:98)
at 
org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:114)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:94)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.phoenix.memory.InsufficientMemoryException: Requested 
memory of 5760 bytes could not be allocated from remaining memory of 35568 
bytes from global pool of 4 bytes after waiting for 0ms.
at 
org.apache.phoenix.memory.GlobalMemoryManager.allocateBytes(GlobalMemoryManager.java:81)
at 
org.apache.phoenix.memory.GlobalMemoryManager.allocate(GlobalMemoryManager.java:100)
at 
org.apache.phoenix.memory.GlobalMemoryManager.allocate(GlobalMemoryManager.java:106)
at 
org.apache.phoenix.cache.aggcache.SpillableGroupByCache.(SpillableGroupByCache.java:150)
at 
org.apache.phoenix.coprocessor.GroupedAggregateRegionObserver$GroupByCacheFactory.newCache(GroupedAggregateRegionObserver.java:365)
at 
org.apache.phoenix.coprocessor.GroupedAggregateRegionObserver.scanUnordered(GroupedAggregateRegionObserver.java:400)
at 
org.apache.phoenix.coprocessor.GroupedAggregateRegionObserver.doPostScannerOpen(GroupedAggregateRegionObserver.java:161)
at 
org.apache.phoenix.coprocessor.BaseScannerRegionObserver.postScannerOpen(BaseScannerRegionObserver.java:140)
... 8 more

at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:262)
at java.util.concurrent.FutureTask.get(FutureTask.java:119)
at 
org.apache.phoenix.iterate.ParallelIterators.getIterators(ParallelIterators.java:281)
at 
org.apache.phoenix.iterate.MergeSortResultIterator.getIterators(MergeSortResultIterator.java:48)
at 
org.apache.phoenix.iterate.MergeSortResultIterator.minIterator(MergeSortResultIterator.java:63)
at 
org.apache.phoenix.iterate.MergeSortResultIterator.next(MergeSortResultIterator.java:90)
at 
org.apache.phoenix.iterate.GroupedAggregatingResultIterator.next(GroupedAggregatingResultIterator.java:68)
at 
org.apache.phoenix.iterate.OrderedResultIterator.getResultIterator(OrderedResultIterator.java:215)
at 
org.apache.phoenix.iterate.OrderedResultIterator.next(OrderedResultIterator.java:169)
at 
org.apache.phoenix.iterate.OrderedAggregatingResultIterator.next(OrderedAggregatingResultIterator.java:50)
at 
org.apache.phoenix.iterate.DelegateResultIterator.next(DelegateResultIterator.java:40)
at 
org.apache.phoenix.jdbc.PhoenixResultSet.next(PhoenixResultSet.java:732)
at 
org.apache.phoenix.end2end.HashJoinIT.testSubJoin(HashJoinIT.java:3296)
Caused by: org.apache.phoenix.exception.PhoenixIOException: 
org.apache.hadoop.hbase.DoNotRetryIOException: 
Join.OrderTable,,1411806340009.4733f67f56ac3c97ce39633f1eb8057e.: Requested 
memory of 5760 bytes could not be allocated from remaining memory of 35568 
bytes from global pool of 4 bytes after waiting for 0ms.
at 
org.apache.phoenix.util.ServerUtil.createIOException(ServerUtil.java:77)
at 
org.apache.phoenix.util.ServerUtil.throwIOException(ServerUtil.java:45)
at 
org.apache.phoenix.coprocessor.BaseScannerRegionObserver.postScannerOpen(BaseScannerRegionObserver.java:158)
at 
org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.postScannerOpen(RegionCoprocessorHost.java:1845)
at 
org.apache.hadoop.hbase.regionserver.HRegionServer.scan(HRegionServer.java:3092)
at 
org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:29497)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2027)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:98)
at 
org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:114)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:94)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.phoenix.memory.InsufficientMemoryException: Requested 
memory of 5760 bytes could not be allocated from remaining memory of 35568 
bytes from global pool of 4 bytes after waiting for 0ms.
at 
org.apache.phoenix.memory.GlobalMemoryManager.all

Jenkins build is back to normal : Phoenix | 3.0 | Hadoop1 #230

2014-09-27 Thread Apache Jenkins Server
See 



Jenkins build is back to normal : Phoenix | 4.0 | Hadoop1 #340

2014-09-27 Thread Apache Jenkins Server
See 



Build failed in Jenkins: Phoenix | Master | Hadoop1 #389

2014-09-27 Thread Apache Jenkins Server
See 

Changes:

[jtaylor] PHOENIX-1298 Queries on fixed width type columns that have an index 
declared on them don't use that index

--
[...truncated 807 lines...]
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:98)
at 
org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:114)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:94)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.phoenix.memory.InsufficientMemoryException: Requested 
memory of 104000 bytes is larger than global pool of 4 bytes.
at 
org.apache.phoenix.memory.GlobalMemoryManager.allocateBytes(GlobalMemoryManager.java:72)
at 
org.apache.phoenix.memory.GlobalMemoryManager.allocate(GlobalMemoryManager.java:100)
at 
org.apache.phoenix.memory.GlobalMemoryManager.allocate(GlobalMemoryManager.java:106)
at 
org.apache.phoenix.coprocessor.ScanRegionObserver.getTopNScanner(ScanRegionObserver.java:235)
at 
org.apache.phoenix.coprocessor.ScanRegionObserver.doPostScannerOpen(ScanRegionObserver.java:222)
at 
org.apache.phoenix.coprocessor.BaseScannerRegionObserver.postScannerOpen(BaseScannerRegionObserver.java:140)
... 8 more

at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:262)
at java.util.concurrent.FutureTask.get(FutureTask.java:119)
at 
org.apache.phoenix.iterate.ParallelIterators.getIterators(ParallelIterators.java:281)
at 
org.apache.phoenix.iterate.MergeSortResultIterator.getIterators(MergeSortResultIterator.java:48)
at 
org.apache.phoenix.iterate.MergeSortResultIterator.minIterator(MergeSortResultIterator.java:63)
at 
org.apache.phoenix.iterate.MergeSortResultIterator.next(MergeSortResultIterator.java:90)
at 
org.apache.phoenix.iterate.MergeSortTopNResultIterator.next(MergeSortTopNResultIterator.java:87)
at 
org.apache.phoenix.jdbc.PhoenixResultSet.next(PhoenixResultSet.java:732)
at 
org.apache.phoenix.end2end.SortOrderFIT.runQuery(SortOrderFIT.java:396)
at 
org.apache.phoenix.end2end.SortOrderFIT.runQueryTest(SortOrderFIT.java:353)
at 
org.apache.phoenix.end2end.SortOrderFIT.queryDescDateWithExplicitOrderBy(SortOrderFIT.java:251)
Caused by: org.apache.phoenix.exception.PhoenixIOException: 
org.apache.hadoop.hbase.DoNotRetryIOException: 
DESCCOLUMNSORTORDERTEST,,1411804439244.2ef89769d7676117d28edadfd4244de6.: 
Requested memory of 104000 bytes is larger than global pool of 4 bytes.
at 
org.apache.phoenix.util.ServerUtil.createIOException(ServerUtil.java:77)
at 
org.apache.phoenix.util.ServerUtil.throwIOException(ServerUtil.java:45)
at 
org.apache.phoenix.coprocessor.BaseScannerRegionObserver.postScannerOpen(BaseScannerRegionObserver.java:158)
at 
org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.postScannerOpen(RegionCoprocessorHost.java:1845)
at 
org.apache.hadoop.hbase.regionserver.HRegionServer.scan(HRegionServer.java:3092)
at 
org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:29497)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2027)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:98)
at 
org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:114)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:94)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.phoenix.memory.InsufficientMemoryException: Requested 
memory of 104000 bytes is larger than global pool of 4 bytes.
at 
org.apache.phoenix.memory.GlobalMemoryManager.allocateBytes(GlobalMemoryManager.java:72)
at 
org.apache.phoenix.memory.GlobalMemoryManager.allocate(GlobalMemoryManager.java:100)
at 
org.apache.phoenix.memory.GlobalMemoryManager.allocate(GlobalMemoryManager.java:106)
at 
org.apache.phoenix.coprocessor.ScanRegionObserver.getTopNScanner(ScanRegionObserver.java:235)
at 
org.apache.phoenix.coprocessor.ScanRegionObserver.doPostScannerOpen(ScanRegionObserver.java:222)
at 
org.apache.phoenix.coprocessor.BaseScannerRegionObserver.postScannerOpen(BaseScannerRegionObserver.java:140)
... 8 more

at 
org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:101)
at 
org.apache.phoenix.iterate.TableResultIterator.(TableResultIterator.java:57)
at 
org.apache.phoenix.iterate.ParallelIterators$3.call(ParallelIterators.java:363)
at 
org.apache.phoenix.iterate.ParallelIterators$3.call(ParallelIterators.java:358)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at 
java.util.concurrent.ThreadPoolExecutor.ru

git commit: PHOENIX-1298 Queries on fixed width type columns that have an index declared on them don't use that index

2014-09-27 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/3.0 3719b6db3 -> 5e48b32b4


PHOENIX-1298 Queries on fixed width type columns that have an index declared on 
them don't use that index

Conflicts:
phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/5e48b32b
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5e48b32b
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5e48b32b

Branch: refs/heads/3.0
Commit: 5e48b32b4e0015e91c7457c87e27011ab6833c20
Parents: 3719b6d
Author: James Taylor 
Authored: Sat Sep 27 00:35:54 2014 -0700
Committer: James Taylor 
Committed: Sat Sep 27 00:40:38 2014 -0700

--
 .../apache/phoenix/compile/WhereOptimizer.java   | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5e48b32b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
index 0aac822..9cd7e01 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
@@ -476,10 +476,22 @@ public class WhereOptimizer {
 for (int i = 0; i < childSlots.size(); i++) {
 KeySlots slots = childSlots.get(i);
 KeySlot keySlot = slots.iterator().next();
+List childExtractNodes = 
keySlot.getKeyPart().getExtractNodes();
+// Stop if there was a gap in extraction of RVC elements. This 
is required if the leading
+// RVC has not row key columns, as we'll still get childSlots 
if the RVC has trailing row
+// key columns. We can't rule the RVC out completely when the 
childSlots is less the the
+// RVC length, as a partial, *leading* match is optimizable.
+if (childExtractNodes.size() != 1 || 
!childExtractNodes.get(0).equals(rvc.getChildren().get(i))) {
+break;
+}
+int pkPosition = keySlot.getPKPosition();
+if (pkPosition < 0) { // break for non PK columns
+break;
+}
 // Continue while we have consecutive pk columns
 if (position == -1) {
-position = initialPosition = keySlot.getPKPosition();
-} else if (keySlot.getPKPosition() != position) {
+position = initialPosition = pkPosition;
+} else if (pkPosition != position) {
 break;
 }
 position++;
@@ -518,6 +530,7 @@ public class WhereOptimizer {
 if (isDegenerate(slot.getKeyRanges())) {
 return DEGENERATE_KEY_PARTS;
 }
+final List extractNodes = 
Collections.singletonList(node);
 final KeyPart childPart = slot.getKeyPart();
 final ImmutableBytesWritable ptr = context.getTempPtr();
 return new SingleKeySlot(new KeyPart() {
@@ -547,7 +560,7 @@ public class WhereOptimizer {
 
 @Override
 public List getExtractNodes() {
-return childPart.getExtractNodes();
+return extractNodes;
 }
 
 @Override



git commit: PHOENIX-1298 Queries on fixed width type columns that have an index declared on them don't use that index

2014-09-27 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master 9241c73a5 -> 0fba23f3a


PHOENIX-1298 Queries on fixed width type columns that have an index declared on 
them don't use that index


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/0fba23f3
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/0fba23f3
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/0fba23f3

Branch: refs/heads/master
Commit: 0fba23f3a986ae0f5c90997786217c455329bbbe
Parents: 9241c73
Author: James Taylor 
Authored: Sat Sep 27 00:35:54 2014 -0700
Committer: James Taylor 
Committed: Sat Sep 27 00:36:49 2014 -0700

--
 .../apache/phoenix/compile/WhereOptimizer.java   | 19 ---
 .../java/org/apache/phoenix/query/BaseTest.java  |  2 +-
 2 files changed, 17 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0fba23f3/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
index 22594c9..51da924 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
@@ -476,10 +476,22 @@ public class WhereOptimizer {
 for (int i = 0; i < childSlots.size(); i++) {
 KeySlots slots = childSlots.get(i);
 KeySlot keySlot = slots.iterator().next();
+List childExtractNodes = 
keySlot.getKeyPart().getExtractNodes();
+// Stop if there was a gap in extraction of RVC elements. This 
is required if the leading
+// RVC has not row key columns, as we'll still get childSlots 
if the RVC has trailing row
+// key columns. We can't rule the RVC out completely when the 
childSlots is less the the
+// RVC length, as a partial, *leading* match is optimizable.
+if (childExtractNodes.size() != 1 || 
!childExtractNodes.get(0).equals(rvc.getChildren().get(i))) {
+break;
+}
+int pkPosition = keySlot.getPKPosition();
+if (pkPosition < 0) { // break for non PK columns
+break;
+}
 // Continue while we have consecutive pk columns
 if (position == -1) {
-position = initialPosition = keySlot.getPKPosition();
-} else if (keySlot.getPKPosition() != position) {
+position = initialPosition = pkPosition;
+} else if (pkPosition != position) {
 break;
 }
 position++;
@@ -518,6 +530,7 @@ public class WhereOptimizer {
 if (isDegenerate(slot.getKeyRanges())) {
 return EMPTY_KEY_SLOTS;
 }
+final List extractNodes = 
Collections.singletonList(node);
 final KeyPart childPart = slot.getKeyPart();
 final ImmutableBytesWritable ptr = context.getTempPtr();
 return new SingleKeySlot(new KeyPart() {
@@ -547,7 +560,7 @@ public class WhereOptimizer {
 
 @Override
 public List getExtractNodes() {
-return childPart.getExtractNodes();
+return extractNodes;
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0fba23f3/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
--
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java 
b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
index c7a7c3e..11f394f 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
@@ -1325,7 +1325,7 @@ public abstract class BaseTest {
 count++;
 }
 assertTrue("Could not find " + errorResult + " in expected results: " 
+ expectedResults + " with actual results: " + actualResults, errorResult == 
null);
-assertEquals(count, expectedCount);
+assertEquals(expectedCount, count);
 }
 
 public HBaseTestingUtility getUtility() {



git commit: PHOENIX-1298 Queries on fixed width type columns that have an index declared on them don't use that index

2014-09-27 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.0 ab2813b66 -> 02d480477


PHOENIX-1298 Queries on fixed width type columns that have an index declared on 
them don't use that index


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/02d48047
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/02d48047
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/02d48047

Branch: refs/heads/4.0
Commit: 02d480477df04a538b344d228d8067d1cfd107b8
Parents: ab2813b
Author: James Taylor 
Authored: Sat Sep 27 00:35:54 2014 -0700
Committer: James Taylor 
Committed: Sat Sep 27 00:35:54 2014 -0700

--
 .../apache/phoenix/compile/WhereOptimizer.java   | 19 ---
 .../java/org/apache/phoenix/query/BaseTest.java  |  2 +-
 2 files changed, 17 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/02d48047/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
index 22594c9..51da924 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
@@ -476,10 +476,22 @@ public class WhereOptimizer {
 for (int i = 0; i < childSlots.size(); i++) {
 KeySlots slots = childSlots.get(i);
 KeySlot keySlot = slots.iterator().next();
+List childExtractNodes = 
keySlot.getKeyPart().getExtractNodes();
+// Stop if there was a gap in extraction of RVC elements. This 
is required if the leading
+// RVC has not row key columns, as we'll still get childSlots 
if the RVC has trailing row
+// key columns. We can't rule the RVC out completely when the 
childSlots is less the the
+// RVC length, as a partial, *leading* match is optimizable.
+if (childExtractNodes.size() != 1 || 
!childExtractNodes.get(0).equals(rvc.getChildren().get(i))) {
+break;
+}
+int pkPosition = keySlot.getPKPosition();
+if (pkPosition < 0) { // break for non PK columns
+break;
+}
 // Continue while we have consecutive pk columns
 if (position == -1) {
-position = initialPosition = keySlot.getPKPosition();
-} else if (keySlot.getPKPosition() != position) {
+position = initialPosition = pkPosition;
+} else if (pkPosition != position) {
 break;
 }
 position++;
@@ -518,6 +530,7 @@ public class WhereOptimizer {
 if (isDegenerate(slot.getKeyRanges())) {
 return EMPTY_KEY_SLOTS;
 }
+final List extractNodes = 
Collections.singletonList(node);
 final KeyPart childPart = slot.getKeyPart();
 final ImmutableBytesWritable ptr = context.getTempPtr();
 return new SingleKeySlot(new KeyPart() {
@@ -547,7 +560,7 @@ public class WhereOptimizer {
 
 @Override
 public List getExtractNodes() {
-return childPart.getExtractNodes();
+return extractNodes;
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/02d48047/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
--
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java 
b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
index c7a7c3e..11f394f 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
@@ -1325,7 +1325,7 @@ public abstract class BaseTest {
 count++;
 }
 assertTrue("Could not find " + errorResult + " in expected results: " 
+ expectedResults + " with actual results: " + actualResults, errorResult == 
null);
-assertEquals(count, expectedCount);
+assertEquals(expectedCount, count);
 }
 
 public HBaseTestingUtility getUtility() {