Build failed in Jenkins: Phoenix-4.8-HBase-1.1 #58

2016-12-24 Thread Apache Jenkins Server
See 

Changes:

[elserj] PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator

--
[...truncated 1033 lines...]
at 
org.apache.hadoop.hbase.regionserver.RSRpcServices.doNonAtomicRegionMutation(RSRpcServices.java:662)
at 
org.apache.hadoop.hbase.regionserver.RSRpcServices.multi(RSRpcServices.java:2046)
at 
org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:32393)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2117)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:104)
at 
org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:133)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:108)
at java.lang.Thread.run(Thread.java:745)
: 2 times, 
at 
org.apache.hadoop.hbase.client.AsyncProcess$BatchErrors.makeException(AsyncProcess.java:228)
at 
org.apache.hadoop.hbase.client.AsyncProcess$BatchErrors.access$1700(AsyncProcess.java:208)
at 
org.apache.hadoop.hbase.client.AsyncProcess$AsyncRequestFutureImpl.getErrors(AsyncProcess.java:1599)
at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:936)
at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:950)
at 
org.apache.hadoop.hbase.client.HTableWrapper.batch(HTableWrapper.java:255)
at 
org.apache.phoenix.execute.DelegateHTable.batch(DelegateHTable.java:94)
at 
org.apache.phoenix.hbase.index.write.ParallelWriterIndexCommitter$1.call(ParallelWriterIndexCommitter.java:167)
at 
org.apache.phoenix.hbase.index.write.ParallelWriterIndexCommitter$1.call(ParallelWriterIndexCommitter.java:131)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
... 1 more
: 1 time, 
at 
org.apache.phoenix.end2end.index.MutableIndexFailureIT.helpTestWriteFailureDisablesIndex(MutableIndexFailureIT.java:225)
at 
org.apache.phoenix.end2end.index.MutableIndexFailureIT.testWriteFailureDisablesIndex(MutableIndexFailureIT.java:127)

testWriteFailureDisablesIndex[transactional = false, localIndex = false, 
isNamespaceMapped = 
true](org.apache.phoenix.end2end.index.MutableIndexFailureIT)  Time elapsed: 
25.666 sec  <<< ERROR!
org.apache.phoenix.exception.PhoenixIOException: 
org.apache.phoenix.exception.PhoenixIOException: 
org.apache.hadoop.hbase.DoNotRetryIOException
at 
org.apache.phoenix.end2end.index.MutableIndexFailureIT$FailingRegionObserver.preBatchMutate(MutableIndexFailureIT.java:393)
at 
org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$35.call(RegionCoprocessorHost.java:1024)
at 
org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$RegionOperation.call(RegionCoprocessorHost.java:1708)
at 
org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperation(RegionCoprocessorHost.java:1783)
at 
org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperation(RegionCoprocessorHost.java:1740)
at 
org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.preBatchMutate(RegionCoprocessorHost.java:1020)
at 
org.apache.hadoop.hbase.regionserver.HRegion.doMiniBatchMutation(HRegion.java:3078)
at 
org.apache.hadoop.hbase.regionserver.HRegion.batchMutate(HRegion.java:2853)
at 
org.apache.hadoop.hbase.regionserver.HRegion.batchMutate(HRegion.java:2795)
at 
org.apache.phoenix.coprocessor.UngroupedAggregateRegionObserver.commitBatch(UngroupedAggregateRegionObserver.java:202)
at 
org.apache.phoenix.coprocessor.UngroupedAggregateRegionObserver.doPostScannerOpen(UngroupedAggregateRegionObserver.java:620)
at 
org.apache.phoenix.coprocessor.BaseScannerRegionObserver$RegionScannerHolder.overrideDelegate(BaseScannerRegionObserver.java:214)
at 
org.apache.phoenix.coprocessor.BaseScannerRegionObserver$RegionScannerHolder.nextRaw(BaseScannerRegionObserver.java:259)
at 
org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:2420)
at 
org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:32385)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2117)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:104)
at 
org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:133)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:108)
at java.lang.Thread.run(Thread.java:745)

Caused by: java.util.concurrent.ExecutionException: 
org.apache.phoenix.exception.PhoenixIOException: 
org.apache.hadoop.hbase.DoNotRetryIOException
at 

Apache-Phoenix | 4.x-HBase-1.0 | Build Successful

2016-12-24 Thread Apache Jenkins Server
4.x-HBase-1.0 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.x-HBase-1.0

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.x-HBase-1.0/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.x-HBase-1.0/lastCompletedBuild/testReport/

Changes
[elserj] PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


Apache-Phoenix | 4.8-HBase-0.98 | Build Successful

2016-12-24 Thread Apache Jenkins Server
4.8-HBase-0.98 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.8-HBase-0.98

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.8-HBase-0.98/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.8-HBase-0.98/lastCompletedBuild/testReport/

Changes
[elserj] PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


Apache-Phoenix | 4.8-HBase-1.0 | Build Successful

2016-12-24 Thread Apache Jenkins Server
4.8-HBase-1.0 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.8-HBase-1.0

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.8-HBase-1.0/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.8-HBase-1.0/lastCompletedBuild/testReport/

Changes
[elserj] PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


[5/6] phoenix git commit: PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator

2016-12-24 Thread elserj
PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator


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

Branch: refs/heads/4.8-HBase-1.0
Commit: b7cd8b500e7816f80a2521b2e1a35d85b440e356
Parents: e7c63d5
Author: Josh Elser 
Authored: Wed Nov 23 11:16:35 2016 -0500
Committer: Josh Elser 
Committed: Sat Dec 24 23:44:35 2016 -0500

--
 .../phoenix/iterate/OrderedResultIterator.java  |  5 ++-
 .../iterate/OrderedResultIteratorTest.java  | 41 
 2 files changed, 45 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b7cd8b50/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
index 8dcb2e8..da75bb7 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
@@ -279,7 +279,10 @@ public class OrderedResultIterator implements 
PeekingResultIterator {
 
 @Override
 public void close() throws SQLException {
-resultIterator.close();
+// Guard against resultIterator being null
+if (null != resultIterator) {
+resultIterator.close();
+}
 resultIterator = PeekingResultIterator.EMPTY_ITERATOR;
 }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b7cd8b50/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
new file mode 100644
index 000..50ed8e9
--- /dev/null
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.iterate;
+
+import java.sql.SQLException;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.phoenix.expression.OrderByExpression;
+import org.junit.Test;
+
+/**
+ * Test class for {@link OrderedResultIterator}.
+ */
+public class OrderedResultIteratorTest {
+
+  @Test
+  public void testNullIteratorOnClose() throws SQLException {
+  ResultIterator delegate =  ResultIterator.EMPTY_ITERATOR;
+  List orderByExpressions = 
Collections.singletonList(null);
+  int thresholdBytes = Integer.MAX_VALUE;
+  OrderedResultIterator iterator = new OrderedResultIterator(delegate, 
orderByExpressions, thresholdBytes);
+  // Should not throw an exception
+  iterator.close();
+  }
+
+}



[3/6] phoenix git commit: PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator

2016-12-24 Thread elserj
PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator


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

Branch: refs/heads/4.8-HBase-1.2
Commit: 45b789223b4368b202d9cf14634fdbfddf7671e0
Parents: 3d42051
Author: Josh Elser 
Authored: Wed Nov 23 11:16:35 2016 -0500
Committer: Josh Elser 
Committed: Sat Dec 24 23:36:29 2016 -0500

--
 .../phoenix/iterate/OrderedResultIterator.java  |  5 ++-
 .../iterate/OrderedResultIteratorTest.java  | 41 
 2 files changed, 45 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/45b78922/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
index 8dcb2e8..da75bb7 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
@@ -279,7 +279,10 @@ public class OrderedResultIterator implements 
PeekingResultIterator {
 
 @Override
 public void close() throws SQLException {
-resultIterator.close();
+// Guard against resultIterator being null
+if (null != resultIterator) {
+resultIterator.close();
+}
 resultIterator = PeekingResultIterator.EMPTY_ITERATOR;
 }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/45b78922/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
new file mode 100644
index 000..50ed8e9
--- /dev/null
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.iterate;
+
+import java.sql.SQLException;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.phoenix.expression.OrderByExpression;
+import org.junit.Test;
+
+/**
+ * Test class for {@link OrderedResultIterator}.
+ */
+public class OrderedResultIteratorTest {
+
+  @Test
+  public void testNullIteratorOnClose() throws SQLException {
+  ResultIterator delegate =  ResultIterator.EMPTY_ITERATOR;
+  List orderByExpressions = 
Collections.singletonList(null);
+  int thresholdBytes = Integer.MAX_VALUE;
+  OrderedResultIterator iterator = new OrderedResultIterator(delegate, 
orderByExpressions, thresholdBytes);
+  // Should not throw an exception
+  iterator.close();
+  }
+
+}



[1/6] phoenix git commit: PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator

2016-12-24 Thread elserj
Repository: phoenix
Updated Branches:
  refs/heads/4.8-HBase-0.98 cf6c4f7c4 -> d7d28f19b
  refs/heads/4.8-HBase-1.0 e7c63d54c -> b7cd8b500
  refs/heads/4.8-HBase-1.1 40de1f6cd -> d5d856391
  refs/heads/4.8-HBase-1.2 3d4205123 -> 45b789223
  refs/heads/4.x-HBase-1.1 2c99685d6 -> cce9a9f35
  refs/heads/master c5046047a -> e23634a35


PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator


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

Branch: refs/heads/master
Commit: e23634a358929516ce210fe06d668ce475eb
Parents: c504604
Author: Josh Elser 
Authored: Wed Nov 23 11:16:35 2016 -0500
Committer: Josh Elser 
Committed: Sat Dec 24 23:11:10 2016 -0500

--
 .../phoenix/iterate/OrderedResultIterator.java  |  5 ++-
 .../iterate/OrderedResultIteratorTest.java  | 41 
 2 files changed, 45 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e23634a3/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
index 8dcb2e8..da75bb7 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
@@ -279,7 +279,10 @@ public class OrderedResultIterator implements 
PeekingResultIterator {
 
 @Override
 public void close() throws SQLException {
-resultIterator.close();
+// Guard against resultIterator being null
+if (null != resultIterator) {
+resultIterator.close();
+}
 resultIterator = PeekingResultIterator.EMPTY_ITERATOR;
 }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e23634a3/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
new file mode 100644
index 000..50ed8e9
--- /dev/null
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.iterate;
+
+import java.sql.SQLException;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.phoenix.expression.OrderByExpression;
+import org.junit.Test;
+
+/**
+ * Test class for {@link OrderedResultIterator}.
+ */
+public class OrderedResultIteratorTest {
+
+  @Test
+  public void testNullIteratorOnClose() throws SQLException {
+  ResultIterator delegate =  ResultIterator.EMPTY_ITERATOR;
+  List orderByExpressions = 
Collections.singletonList(null);
+  int thresholdBytes = Integer.MAX_VALUE;
+  OrderedResultIterator iterator = new OrderedResultIterator(delegate, 
orderByExpressions, thresholdBytes);
+  // Should not throw an exception
+  iterator.close();
+  }
+
+}



[6/6] phoenix git commit: PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator

2016-12-24 Thread elserj
PHOENIX-3505 Avoid NPE on close() in OrderedResultIterator


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

Branch: refs/heads/4.8-HBase-0.98
Commit: d7d28f19bee77d219ac8277523405d120921ba3c
Parents: cf6c4f7
Author: Josh Elser 
Authored: Wed Nov 23 11:16:35 2016 -0500
Committer: Josh Elser 
Committed: Sat Dec 24 23:48:29 2016 -0500

--
 .../phoenix/iterate/OrderedResultIterator.java  |  5 ++-
 .../iterate/OrderedResultIteratorTest.java  | 41 
 2 files changed, 45 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d7d28f19/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
index 8dcb2e8..da75bb7 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
@@ -279,7 +279,10 @@ public class OrderedResultIterator implements 
PeekingResultIterator {
 
 @Override
 public void close() throws SQLException {
-resultIterator.close();
+// Guard against resultIterator being null
+if (null != resultIterator) {
+resultIterator.close();
+}
 resultIterator = PeekingResultIterator.EMPTY_ITERATOR;
 }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d7d28f19/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
new file mode 100644
index 000..50ed8e9
--- /dev/null
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/iterate/OrderedResultIteratorTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.iterate;
+
+import java.sql.SQLException;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.phoenix.expression.OrderByExpression;
+import org.junit.Test;
+
+/**
+ * Test class for {@link OrderedResultIterator}.
+ */
+public class OrderedResultIteratorTest {
+
+  @Test
+  public void testNullIteratorOnClose() throws SQLException {
+  ResultIterator delegate =  ResultIterator.EMPTY_ITERATOR;
+  List orderByExpressions = 
Collections.singletonList(null);
+  int thresholdBytes = Integer.MAX_VALUE;
+  OrderedResultIterator iterator = new OrderedResultIterator(delegate, 
orderByExpressions, thresholdBytes);
+  // Should not throw an exception
+  iterator.close();
+  }
+
+}