Apache-Phoenix | Master | Build Successful

2019-09-05 Thread Apache Jenkins Server
Master branch build status Successful
Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/master

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

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

Changes
[elserj] PHOENIX-5459 Enable running the test suite with JDK11

[elserj] PHOENIX-5461 phoenix-pherf IT failures with JDK11

[elserj] PHOENIX-5460 SortOrderExpressionTest failure with JDK11



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


Apache-Phoenix | Master | Build Successful

2019-09-05 Thread Apache Jenkins Server
Master branch build status Successful
Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/master

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

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

Changes
[gjacoby] PHOENIX-5455 IndexedKeyValue creation fails after HBASE-22034



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


[phoenix] 01/03: PHOENIX-5459 Enable running the test suite with JDK11

2019-09-05 Thread elserj
This is an automated email from the ASF dual-hosted git repository.

elserj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git

commit 0e06588f52b46bbc6b51c97d52981f18923681fa
Author: Istvan Toth 
AuthorDate: Mon Sep 2 11:17:25 2019 +0200

PHOENIX-5459 Enable running the test suite with JDK11

remove unsupported VM option
update surefire and failsafe to 2.22.2

Closes #576

Signed-off-by: Josh Elser 
---
 pom.xml | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 19a597e..833fec1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -124,8 +124,8 @@
 
 2.9
 
1.9.1
-2.20
-2.20
+2.22.2
+2.22.2
 
 2.1
 2.5.2
@@ -254,7 +254,7 @@
 alphabetical
 
--Xmx2000m -XX:MaxPermSize=256m 
-Djava.security.egd=file:/dev/./urandom 
"-Djava.library.path=${hadoop.library.path}${path.separator}${java.library.path}"
 -XX:NewRatio=4 -XX:SurvivorRatio=8 -XX:+UseCompressedOops 
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+DisableExplicitGC 
-XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled 
-XX:+CMSScavengeBeforeRemark -XX:CMSInitiatingOccupancyFraction=68 
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./target/ - [...]
+-Xmx2000m -XX:MaxPermSize=256m 
-Djava.security.egd=file:/dev/./urandom 
"-Djava.library.path=${hadoop.library.path}${path.separator}${java.library.path}"
 -XX:NewRatio=4 -XX:SurvivorRatio=8 -XX:+UseCompressedOops 
-XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC 
-XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled 
-XX:+CMSScavengeBeforeRemark -XX:CMSInitiatingOccupancyFraction=68 
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./target/ -Dorg.apache.hadoo 
[...]
 
${test.output.tofile}
 kill
 
${basedir}/src/it/java
@@ -283,7 +283,7 @@
 at 
org.apache.phoenix.coprocessor.MetaDataEndpointImpl.doGetTable(MetaDataEndpointImpl.java:2835)
 at 
org.apache.phoenix.coprocessor.MetaDataEndpointImpl.getTable(MetaDataEndpointImpl.java:490)
 -->

--Xmx3000m -XX:MaxPermSize=256m 
-Djava.security.egd=file:/dev/./urandom 
"-Djava.library.path=${hadoop.library.path}${path.separator}${java.library.path}"
 -XX:NewRatio=4 -XX:SurvivorRatio=8 -XX:+UseCompressedOops 
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+DisableExplicitGC 
-XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled 
-XX:+CMSScavengeBeforeRemark -XX:CMSInitiatingOccupancyFraction=68 
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./target/ - [...]
+-Xmx3000m -XX:MaxPermSize=256m 
-Djava.security.egd=file:/dev/./urandom 
"-Djava.library.path=${hadoop.library.path}${path.separator}${java.library.path}"
 -XX:NewRatio=4 -XX:SurvivorRatio=8 -XX:+UseCompressedOops 
-XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC 
-XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled 
-XX:+CMSScavengeBeforeRemark -XX:CMSInitiatingOccupancyFraction=68 
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./target/ -Dorg.apache.hadoo 
[...]
 
${test.output.tofile}
 kill
 
${basedir}/src/it/java



[phoenix] 03/03: PHOENIX-5460 SortOrderExpressionTest failure with JDK11

2019-09-05 Thread elserj
This is an automated email from the ASF dual-hosted git repository.

elserj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git

commit a3ff1707f299dd28ac7e43f90d68de1f58ca0342
Author: Istvan Toth 
AuthorDate: Mon Sep 2 12:45:40 2019 +0200

PHOENIX-5460 SortOrderExpressionTest failure with JDK11

Closes #577

Signed-off-by: Josh Elser 
---
 .../apache/phoenix/expression/SortOrderExpressionTest.java| 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/expression/SortOrderExpressionTest.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/expression/SortOrderExpressionTest.java
index e2ab684..c2850a9 100644
--- 
a/phoenix-core/src/test/java/org/apache/phoenix/expression/SortOrderExpressionTest.java
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/expression/SortOrderExpressionTest.java
@@ -146,7 +146,16 @@ public class SortOrderExpressionTest {
 @Test
 public void toChar() throws Exception {
 List args = Lists.newArrayList(getInvertedLiteral(date(12, 
11, 2001), PDate.INSTANCE));
-evaluateAndAssertResult(new ToCharFunction(args, 
FunctionArgumentType.TEMPORAL, "", DateUtil.getDateFormatter("MM/dd/yy hh:mm 
a")), "12/11/01 12:00 AM");
+// We may get AM or am depending on Java version, see JDK-8211985
+// This is just a hack to accept any case, without completely 
rewriting the test logic
+Object caseInsensitiveExpected = new Object() {
+@Override
+public boolean equals(Object other) {
+return (other instanceof String) && "12/11/01 12:00 
AM".equalsIgnoreCase((String) other);
+}
+};
+evaluateAndAssertResult(new ToCharFunction(args, 
FunctionArgumentType.TEMPORAL, "", DateUtil.getDateFormatter("MM/dd/yy hh:mm 
a")),
+caseInsensitiveExpected);
 }
 
 @Test



[phoenix] 02/03: PHOENIX-5461 phoenix-pherf IT failures with JDK11

2019-09-05 Thread elserj
This is an automated email from the ASF dual-hosted git repository.

elserj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git

commit ea7a21814dbfee181a1b3486b10d01d0b22d653f
Author: Istvan Toth 
AuthorDate: Mon Sep 2 13:53:17 2019 +0200

PHOENIX-5461 phoenix-pherf IT failures with JDK11

Closes #578

Signed-off-by: Josh Elser 
---
 phoenix-pherf/pom.xml  | 22 +-
 .../apache/phoenix/pherf/configuration/Column.java |  5 -
 .../pherf/configuration/XMLConfigParser.java   | 16 +++-
 .../apache/phoenix/pherf/util/ResourceList.java|  3 ++-
 4 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index 6ac62b3..31bd638 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -109,11 +109,23 @@
hadoop-minicluster
test

-
-  org.mockito
-  mockito-all
-  test
-
+   
+   org.mockito
+   mockito-all
+   test
+   
+   
+   
+   jakarta.activation
+   jakarta.activation-api
+   1.2.1
+   
+   
+   org.glassfish.jaxb
+   jaxb-runtime
+   2.3.2
+   test
+   

 

diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
index c121451..60646ea 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
@@ -211,11 +211,6 @@ public class Column {
 @XmlElement(name = "datavalue")
 public void setDataValues(List dataValues) {
 this.dataValues = dataValues;
-
-// DataValue type is inherited from the column
-for (DataValue value : dataValues) {
-value.setType(getType());
-}
 }
 
 public String getPrefix() {
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/XMLConfigParser.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/XMLConfigParser.java
index 87b4403..104fab5 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/XMLConfigParser.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/XMLConfigParser.java
@@ -36,6 +36,7 @@ import javax.xml.transform.stream.StreamSource;
 
 import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.exception.FileLoaderException;
+import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.util.ResourceList;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -176,7 +177,20 @@ public class XMLConfigParser {
 }
 for (Path path : this.paths) {
 System.out.println("Adding model for path:" + path.toString());
-this.dataModels.add(XMLConfigParser.readDataModel(path));
+DataModel dataModel = XMLConfigParser.readDataModel(path);
+updateDataValueType(dataModel);
+this.dataModels.add(dataModel);
+}
+}
+
+private void updateDataValueType(DataModel dataModel) {
+for (Column column : dataModel.getDataMappingColumns()) {
+if (column.getDataValues() != null) {
+// DataValue type is inherited from the column
+for (DataValue value : column.getDataValues()) {
+value.setType(column.getType());
+}
+}
 }
 }
 
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/ResourceList.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/ResourceList.java
index df5dbf7..cec12d1 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/ResourceList.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/ResourceList.java
@@ -28,6 +28,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URL;
+import java.nio.file.NoSuchFileException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.*;
@@ -130,7 +131,7 @@ public class ResourceList {
 ZipFile zf;
 try {
 zf = new ZipFile(file);
-} catch (FileNotFoundException e) {
+} catch (FileNotFoundException|NoSuchFileException e) {
 // Gracefully handle a jar listed on the classpath that doesn't 
actually exist.
 return Collections.emptyList();
 } catch (final ZipException e) {



[phoenix] branch master updated (50a6aeb -> a3ff170)

2019-09-05 Thread elserj
This is an automated email from the ASF dual-hosted git repository.

elserj pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git.


from 50a6aeb  PHOENIX-5455 IndexedKeyValue creation fails after HBASE-22034
 new 0e06588  PHOENIX-5459 Enable running the test suite with JDK11
 new ea7a218  PHOENIX-5461 phoenix-pherf IT failures with JDK11
 new a3ff170  PHOENIX-5460 SortOrderExpressionTest failure with JDK11

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../expression/SortOrderExpressionTest.java| 11 ++-
 phoenix-pherf/pom.xml  | 22 +-
 .../apache/phoenix/pherf/configuration/Column.java |  5 -
 .../pherf/configuration/XMLConfigParser.java   | 16 +++-
 .../apache/phoenix/pherf/util/ResourceList.java|  3 ++-
 pom.xml|  8 
 6 files changed, 48 insertions(+), 17 deletions(-)



[phoenix-queryserver] branch master updated: PHOENIX-5459 Enable running the test suite with JDK11

2019-09-05 Thread elserj
This is an automated email from the ASF dual-hosted git repository.

elserj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix-queryserver.git


The following commit(s) were added to refs/heads/master by this push:
 new c4c9a8a  PHOENIX-5459 Enable running the test suite with JDK11
c4c9a8a is described below

commit c4c9a8a4a831854b8a6a38487ce7a2f2bd8de9f5
Author: Istvan Toth 
AuthorDate: Mon Sep 2 11:22:16 2019 +0200

PHOENIX-5459 Enable running the test suite with JDK11

remove unsupported VM option
update surefire and failsafe to 2.22.2

Closes #10

Signed-off-by: Josh Elser 
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4123556..9f8cc87 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,8 +85,8 @@
 
 2.9
 
1.9.1
-2.20
-2.20
+2.22.2
+2.22.2
 
 2.1
 2.5.2
@@ -203,7 +203,7 @@
 alphabetical
 false
 alphabetical
--Xmx2000m -XX:MaxPermSize=256m 
-Djava.security.egd=file:/dev/./urandom 
"-Djava.library.path=${hadoop.library.path}${path.separator}${java.library.path}"
 -XX:NewRatio=4 -XX:SurvivorRatio=8 -XX:+UseCompressedOops 
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+DisableExplicitGC 
-XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled 
-XX:+CMSScavengeBeforeRemark -XX:CMSInitiatingOccupancyFraction=68 
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDump [...]
+-Xmx2000m -XX:MaxPermSize=256m 
-Djava.security.egd=file:/dev/./urandom 
"-Djava.library.path=${hadoop.library.path}${path.separator}${java.library.path}"
 -XX:NewRatio=4 -XX:SurvivorRatio=8 -XX:+UseCompressedOops 
-XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC 
-XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled 
-XX:+CMSScavengeBeforeRemark -XX:CMSInitiatingOccupancyFraction=68 
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./target/
 
true
 kill
 
${basedir}/src/it/java



[phoenix] branch master updated (ac2976c -> 50a6aeb)

2019-09-05 Thread gjacoby
This is an automated email from the ASF dual-hosted git repository.

gjacoby pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git.


from ac2976c  PHOENIX-5451 Column pruning for Subselect
 add 50a6aeb  PHOENIX-5455 IndexedKeyValue creation fails after HBASE-22034

No new revisions were added by this update.

Summary of changes:
 .../org/apache/phoenix/hbase/index/Indexer.java|  21 +---
 .../phoenix/hbase/index/wal/IndexedKeyValue.java   | 129 +++--
 .../phoenix/hbase/index/wal/KeyValueCodec.java |  17 ++-
 .../regionserver/wal/IndexedKeyValueTest.java  |  50 ++--
 .../wal/ReadWriteKeyValuesWithCodecTest.java   |   3 +-
 5 files changed, 98 insertions(+), 122 deletions(-)



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

2019-09-05 Thread Apache Jenkins Server
4.x-HBase-1.3 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.3

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

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

Changes
[chenglei] PHOENIX-5451 Column pruning for Subselect



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


Build failed in Jenkins: Phoenix-4.x-HBase-1.4 #249

2019-09-05 Thread Apache Jenkins Server
See 


Changes:

[chenglei] PHOENIX-5451 Column pruning for Subselect

--
[...truncated 1.19 MB...]
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 31.419 s 
- in org.apache.phoenix.util.IndexScrutinyIT
[INFO] Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 341.379 
s - in org.apache.phoenix.end2end.join.SubqueryUsingSortMergeJoinIT
[INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 503.703 
s - in org.apache.phoenix.end2end.join.SubqueryIT
[INFO] Tests run: 28, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 383.561 
s - in org.apache.phoenix.tx.TransactionIT
[INFO] Tests run: 90, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 
1,185.567 s - in org.apache.phoenix.end2end.index.MutableIndexIT
[INFO] Tests run: 66, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 707.254 
s - in org.apache.phoenix.tx.ParameterizedTransactionIT
[INFO] Tests run: 50, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 685.048 
s - in org.apache.phoenix.tx.TxCheckpointIT
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   IndexMetadataIT.testAsyncRebuildAll:679 expected:<[COMPLE]TED> but 
was:<[STAR]TED>
[INFO] 
[ERROR] Tests run: 3684, Failures: 1, Errors: 0, Skipped: 2
[INFO] 
[INFO] 
[INFO] --- maven-failsafe-plugin:2.20:integration-test (HBaseManagedTimeTests) 
@ phoenix-core ---
[INFO] 
[INFO] ---
[INFO]  T E S T S
[INFO] ---
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-failsafe-plugin:2.20:integration-test 
(NeedTheirOwnClusterTests) @ phoenix-core ---
[INFO] 
[INFO] ---
[INFO]  T E S T S
[INFO] ---
[INFO] Running 
org.apache.hadoop.hbase.regionserver.wal.WALReplayWithIndexWritesAndCompressedWALIT
[WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.007 
s - in 
org.apache.hadoop.hbase.regionserver.wal.WALReplayWithIndexWritesAndCompressedWALIT
[INFO] Running org.apache.phoenix.end2end.ConnectionUtilIT
[INFO] Running 
org.apache.hadoop.hbase.regionserver.wal.WALRecoveryRegionPostOpenIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.765 s 
- in org.apache.hadoop.hbase.regionserver.wal.WALRecoveryRegionPostOpenIT
[INFO] Running org.apache.phoenix.end2end.CsvBulkLoadToolIT
[INFO] Running org.apache.phoenix.end2end.ConcurrentMutationsExtendedIT
[INFO] Running org.apache.phoenix.end2end.CountDistinctCompressionIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.638 s 
- in org.apache.phoenix.end2end.CountDistinctCompressionIT
[INFO] Running org.apache.phoenix.end2end.ContextClassloaderIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 86.645 s 
- in org.apache.phoenix.end2end.ConnectionUtilIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.661 s 
- in org.apache.phoenix.end2end.ContextClassloaderIT
[INFO] Running org.apache.phoenix.end2end.CostBasedDecisionIT
[INFO] Running org.apache.phoenix.end2end.DropSchemaIT
[INFO] Running org.apache.phoenix.end2end.FlappingLocalIndexIT
[INFO] Running org.apache.phoenix.end2end.IndexBuildTimestampIT
[INFO] Running org.apache.phoenix.end2end.IndexExtendedIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 36.982 s 
- in org.apache.phoenix.end2end.DropSchemaIT
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 163.669 
s - in org.apache.phoenix.end2end.CsvBulkLoadToolIT
[INFO] Running org.apache.phoenix.end2end.IndexRebuildTaskIT
[INFO] Tests run: 20, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 105.574 
s - in org.apache.phoenix.end2end.IndexExtendedIT
[INFO] Running org.apache.phoenix.end2end.IndexToolForPartialBuildIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 28.357 s 
- in org.apache.phoenix.end2end.IndexRebuildTaskIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 23.698 s 
- in org.apache.phoenix.end2end.IndexToolForPartialBuildIT
[INFO] Running 
org.apache.phoenix.end2end.IndexToolForPartialBuildWithNamespaceEnabledIT
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 213.762 
s - in org.apache.phoenix.end2end.FlappingLocalIndexIT
[INFO] Running org.apache.phoenix.end2end.MigrateSystemTablesToSystemNamespaceIT
[INFO] Running org.apache.phoenix.end2end.IndexToolIT
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 232.498 
s - in org.apache.phoenix.end2end.IndexBuildTimestampIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 53.486 s 
- in org.apache.phoenix.end2end.IndexToolForPartialBuildWithNamespaceEnabledIT
[INFO] Running

Jenkins build is back to normal : Phoenix | Master #2500

2019-09-05 Thread Apache Jenkins Server
See 




Build failed in Jenkins: Phoenix Compile Compatibility with HBase #1111

2019-09-05 Thread Apache Jenkins Server
See 


--
Started by timer
[EnvInject] - Loading node environment variables.
Building remotely on H38 (ubuntu xenial) in workspace 

[Phoenix_Compile_Compat_wHBase] $ /bin/bash /tmp/jenkins4468114722093462664.sh
core file size  (blocks, -c) 0
data seg size   (kbytes, -d) unlimited
scheduling priority (-e) 0
file size   (blocks, -f) unlimited
pending signals (-i) 386431
max locked memory   (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files  (-n) 6
pipe size(512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority  (-r) 0
stack size  (kbytes, -s) 8192
cpu time   (seconds, -t) unlimited
max user processes  (-u) 10240
virtual memory  (kbytes, -v) unlimited
file locks  (-x) unlimited
core id : 0
core id : 1
core id : 2
core id : 3
core id : 4
core id : 5
physical id : 0
physical id : 1
MemTotal:   98963744 kB
MemFree:46990520 kB
Filesystem  Size  Used Avail Use% Mounted on
udev 48G 0   48G   0% /dev
tmpfs   9.5G  970M  8.5G  11% /run
/dev/sda3   3.6T  595G  2.9T  18% /
tmpfs48G  872K   48G   1% /dev/shm
tmpfs   5.0M 0  5.0M   0% /run/lock
tmpfs48G 0   48G   0% /sys/fs/cgroup
/dev/sda2   473M  238M  211M  54% /boot
tmpfs   9.5G  4.0K  9.5G   1% /run/user/910
tmpfs   9.5G 0  9.5G   0% /run/user/1000
/dev/loop8   89M   89M 0 100% /snap/core/7270
/dev/loop11  58M   58M 0 100% /snap/snapcraft/3252
/dev/loop4   89M   89M 0 100% /snap/core/7396
/dev/loop2   58M   58M 0 100% /snap/snapcraft/3308
/dev/loop1   55M   55M 0 100% /snap/lxd/11684
/dev/loop9   55M   55M 0 100% /snap/lxd/11727
apache-maven-2.2.1
apache-maven-3.0.4
apache-maven-3.0.5
apache-maven-3.1.1
apache-maven-3.2.1
apache-maven-3.2.5
apache-maven-3.3.3
apache-maven-3.3.9
apache-maven-3.5.0
apache-maven-3.5.2
apache-maven-3.5.4
apache-maven-3.6.0
latest
latest2
latest3


===
Verifying compile level compatibility with HBase 0.98 with Phoenix 
4.x-HBase-0.98
===

Cloning into 'hbase'...
Checking out files:  32% (1549/4779)   Checking out files:  33% (1578/4779)   
Checking out files:  34% (1625/4779)   Checking out files:  35% (1673/4779)   
Checking out files:  36% (1721/4779)   Checking out files:  37% (1769/4779)   
Checking out files:  38% (1817/4779)   Checking out files:  39% (1864/4779)   
Checking out files:  40% (1912/4779)   Checking out files:  41% (1960/4779)   
Checking out files:  42% (2008/4779)   Checking out files:  43% (2055/4779)   
Checking out files:  44% (2103/4779)   Checking out files:  45% (2151/4779)   
Checking out files:  46% (2199/4779)   Checking out files:  47% (2247/4779)   
Checking out files:  48% (2294/4779)   Checking out files:  49% (2342/4779)   
Checking out files:  50% (2390/4779)   Checking out files:  51% (2438/4779)   
Checking out files:  52% (2486/4779)   Checking out files:  53% (2533/4779)   
Checking out files:  54% (2581/4779)   Checking out files:  55% (2629/4779)   
Checking out files:  56% (2677/4779)   Checking out files:  57% (2725/4779)   
Checking out files:  58% (2772/4779)   Checking out files:  59% (2820/4779)   
Checking out files:  60% (2868/4779)   Checking out files:  61% (2916/4779)   
Checking out files:  62% (2963/4779)   Checking out files:  63% (3011/4779)   
Checking out files:  64% (3059/4779)   Checking out files:  65% (3107/4779)   
Checking out files:  66% (3155/4779)   Checking out files:  67% (3202/4779)   
Checking out files:  68% (3250/4779)   Checking out files:  69% (3298/4779)   
Checking out files:  70% (3346/4779)   Checking out files:  71% (3394/4779)   
Checking out files:  72% (3441/4779)   Checking out files:  73% (3489/4779)   
Checking out files:  74% (3537/4779)   Checking out files:  75% (3585/4779)   
Checking out files:  76% (3633/4779)   Checking out files:  77% (3680/4779)   
Checking out files:  78% (3728/4779)   Checking out files:  78% (3744/4779)   
Checking out files:  79% (3776/4779)   Checking out files:  80% (3824/4779)   
Checking out files:  81% (3871/4779)   Checking out files:  82% (3919/4779)   
Checking out files:  83% (3967/4779)   Checking out files:  84% (4015/4779)   
Checking out files:  85% (4063/4779)   Checking out files:  86% (4110/4779)   
Checking out files:  87% (4158/4779)   Checking out files:  88% (4206/4779)   
Checking out files:  89% (4254/4779)   Checking

Jenkins build is back to normal : Phoenix-4.x-HBase-1.3 #531

2019-09-05 Thread Apache Jenkins Server
See 




[phoenix] branch master updated: PHOENIX-5451 Column pruning for Subselect

2019-09-05 Thread chenglei
This is an automated email from the ASF dual-hosted git repository.

chenglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/master by this push:
 new ac2976c  PHOENIX-5451 Column pruning for Subselect
ac2976c is described below

commit ac2976ccbb231c393c364265217966722653da14
Author: chenglei 
AuthorDate: Thu Sep 5 15:44:21 2019 +0800

PHOENIX-5451 Column pruning for Subselect
---
 .../org/apache/phoenix/compile/FromCompiler.java   |  33 +++
 .../org/apache/phoenix/compile/JoinCompiler.java   | 157 ++
 .../apache/phoenix/compile/SubselectRewriter.java  | 214 +++
 .../apache/phoenix/optimize/QueryOptimizer.java|  17 +-
 .../apache/phoenix/parse/ParseNodeRewriter.java|  25 +++
 .../org/apache/phoenix/util/ParseNodeUtil.java | 142 
 .../java/org/apache/phoenix/util/SchemaUtil.java   |  13 +-
 .../phoenix/compile/JoinQueryCompilerTest.java |  31 +--
 .../apache/phoenix/compile/QueryCompilerTest.java  | 237 -
 .../java/org/apache/phoenix/util/TestUtil.java |  28 +++
 10 files changed, 782 insertions(+), 115 deletions(-)

diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
index a1ee0bf..025b867 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
@@ -231,6 +231,22 @@ public class FromCompiler {
 return visitor;
 }
 
+/**
+ * Refresh the inner state of {@link MultiTableColumnResolver} for the 
derivedTableNode when
+ * the derivedTableNode is changed for some sql optimization.
+ * @param columnResolver
+ * @param derivedTableNode
+ * @return
+ * @throws SQLException
+ */
+public static TableRef refreshDerivedTableNode(
+ColumnResolver columnResolver, DerivedTableNode derivedTableNode) 
throws SQLException {
+if(!(columnResolver instanceof MultiTableColumnResolver)) {
+throw new UnsupportedOperationException();
+}
+return 
((MultiTableColumnResolver)columnResolver).refreshDerivedTableNode(derivedTableNode);
+}
+
 public static ColumnResolver getResolverForSchema(UseSchemaStatement 
statement, PhoenixConnection connection)
 throws SQLException {
 return new SchemaResolver(connection, 
SchemaUtil.normalizeIdentifier(statement.getSchemaName()), true);
@@ -899,6 +915,23 @@ public class FromCompiler {
 return null;
 }
 
+/**
+ * Invoke the {@link #visit(DerivedTableNode)} again to refresh the 
inner state.
+ * @param derivedTableNode
+ * @return
+ * @throws SQLException
+ */
+public TableRef refreshDerivedTableNode(DerivedTableNode 
derivedTableNode) throws SQLException {
+  String tableAlias = derivedTableNode.getAlias();
+  List removedTableRefs = 
this.tableMap.removeAll(tableAlias);
+  if(removedTableRefs == null || removedTableRefs.isEmpty()) {
+  return null;
+  }
+  tables.removeAll(removedTableRefs);
+  this.visit(derivedTableNode);
+  return this.resolveTable(null, tableAlias);
+}
+
 private static class ColumnFamilyRef {
 private final TableRef tableRef;
 private final PColumnFamily family;
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
index 618b506..1743748 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
@@ -52,7 +52,6 @@ import org.apache.phoenix.parse.AndBooleanParseNodeVisitor;
 import org.apache.phoenix.parse.AndParseNode;
 import org.apache.phoenix.parse.AndRewriterBooleanParseNodeVisitor;
 import org.apache.phoenix.parse.BindTableNode;
-import org.apache.phoenix.parse.BooleanParseNodeVisitor;
 import org.apache.phoenix.parse.ColumnDef;
 import org.apache.phoenix.parse.ColumnParseNode;
 import org.apache.phoenix.parse.ComparisonParseNode;
@@ -99,6 +98,7 @@ import org.apache.phoenix.schema.types.PVarbinary;
 import org.apache.phoenix.schema.types.PVarchar;
 import org.apache.phoenix.util.EncodedColumnsUtil;
 import org.apache.phoenix.util.IndexUtil;
+import org.apache.phoenix.util.ParseNodeUtil;
 import org.apache.phoenix.util.SchemaUtil;
 
 import com.google.common.base.Preconditions;
@@ -137,6 +137,16 @@ public class JoinCompiler {
 this.useSortMergeJoin = 
select.getHint().hasHint(Hint.USE_SORT_MERGE_JOIN);
 }
 
+/**
+ * After this method is called, the inner state of the parameter resolver 
may be changed by
+ * {@lin

[phoenix] branch 4.x-HBase-1.5 updated: PHOENIX-5451 Column pruning for Subselect

2019-09-05 Thread chenglei
This is an automated email from the ASF dual-hosted git repository.

chenglei pushed a commit to branch 4.x-HBase-1.5
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.5 by this push:
 new 5c269e6  PHOENIX-5451 Column pruning for Subselect
5c269e6 is described below

commit 5c269e6264e8b0f3f1411513abb109c1266395d9
Author: chenglei 
AuthorDate: Thu Sep 5 15:41:37 2019 +0800

PHOENIX-5451 Column pruning for Subselect
---
 .../org/apache/phoenix/compile/FromCompiler.java   |  33 +++
 .../org/apache/phoenix/compile/JoinCompiler.java   | 157 ++
 .../apache/phoenix/compile/SubselectRewriter.java  | 214 +++
 .../apache/phoenix/optimize/QueryOptimizer.java|  17 +-
 .../apache/phoenix/parse/ParseNodeRewriter.java|  25 +++
 .../org/apache/phoenix/util/ParseNodeUtil.java | 142 
 .../java/org/apache/phoenix/util/SchemaUtil.java   |  13 +-
 .../phoenix/compile/JoinQueryCompilerTest.java |  31 +--
 .../apache/phoenix/compile/QueryCompilerTest.java  | 237 -
 .../java/org/apache/phoenix/util/TestUtil.java |  28 +++
 10 files changed, 782 insertions(+), 115 deletions(-)

diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
index 0bdc748..98a58a9 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
@@ -231,6 +231,22 @@ public class FromCompiler {
 return visitor;
 }
 
+/**
+ * Refresh the inner state of {@link MultiTableColumnResolver} for the 
derivedTableNode when
+ * the derivedTableNode is changed for some sql optimization.
+ * @param columnResolver
+ * @param derivedTableNode
+ * @return
+ * @throws SQLException
+ */
+public static TableRef refreshDerivedTableNode(
+ColumnResolver columnResolver, DerivedTableNode derivedTableNode) 
throws SQLException {
+if(!(columnResolver instanceof MultiTableColumnResolver)) {
+throw new UnsupportedOperationException();
+}
+return 
((MultiTableColumnResolver)columnResolver).refreshDerivedTableNode(derivedTableNode);
+}
+
 public static ColumnResolver getResolverForSchema(UseSchemaStatement 
statement, PhoenixConnection connection)
 throws SQLException {
 return new SchemaResolver(connection, 
SchemaUtil.normalizeIdentifier(statement.getSchemaName()), true);
@@ -899,6 +915,23 @@ public class FromCompiler {
 return null;
 }
 
+/**
+ * Invoke the {@link #visit(DerivedTableNode)} again to refresh the 
inner state.
+ * @param derivedTableNode
+ * @return
+ * @throws SQLException
+ */
+public TableRef refreshDerivedTableNode(DerivedTableNode 
derivedTableNode) throws SQLException {
+  String tableAlias = derivedTableNode.getAlias();
+  List removedTableRefs = 
this.tableMap.removeAll(tableAlias);
+  if(removedTableRefs == null || removedTableRefs.isEmpty()) {
+  return null;
+  }
+  tables.removeAll(removedTableRefs);
+  this.visit(derivedTableNode);
+  return this.resolveTable(null, tableAlias);
+}
+
 private static class ColumnFamilyRef {
 private final TableRef tableRef;
 private final PColumnFamily family;
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
index f932a32..f0a2f36 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
@@ -52,7 +52,6 @@ import org.apache.phoenix.parse.AndBooleanParseNodeVisitor;
 import org.apache.phoenix.parse.AndParseNode;
 import org.apache.phoenix.parse.AndRewriterBooleanParseNodeVisitor;
 import org.apache.phoenix.parse.BindTableNode;
-import org.apache.phoenix.parse.BooleanParseNodeVisitor;
 import org.apache.phoenix.parse.ColumnDef;
 import org.apache.phoenix.parse.ColumnParseNode;
 import org.apache.phoenix.parse.ComparisonParseNode;
@@ -100,6 +99,7 @@ import org.apache.phoenix.schema.types.PVarbinary;
 import org.apache.phoenix.schema.types.PVarchar;
 import org.apache.phoenix.util.EncodedColumnsUtil;
 import org.apache.phoenix.util.IndexUtil;
+import org.apache.phoenix.util.ParseNodeUtil;
 import org.apache.phoenix.util.SchemaUtil;
 
 import com.google.common.base.Preconditions;
@@ -138,6 +138,16 @@ public class JoinCompiler {
 this.useSortMergeJoin = 
select.getHint().hasHint(Hint.USE_SORT_MERGE_JOIN);
 }
 
+/**
+ * After this method is called, the inner state of the parameter resolver 
may be changed b

[phoenix] branch 4.x-HBase-1.3 updated: PHOENIX-5451 Column pruning for Subselect

2019-09-05 Thread chenglei
This is an automated email from the ASF dual-hosted git repository.

chenglei pushed a commit to branch 4.x-HBase-1.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.3 by this push:
 new c5c958a  PHOENIX-5451 Column pruning for Subselect
c5c958a is described below

commit c5c958a47c6665fad700ec9d2279f7f045b5a592
Author: chenglei 
AuthorDate: Thu Sep 5 15:39:36 2019 +0800

PHOENIX-5451 Column pruning for Subselect
---
 .../org/apache/phoenix/compile/FromCompiler.java   |  33 +++
 .../org/apache/phoenix/compile/JoinCompiler.java   | 157 ++
 .../apache/phoenix/compile/SubselectRewriter.java  | 214 +++
 .../apache/phoenix/optimize/QueryOptimizer.java|  17 +-
 .../apache/phoenix/parse/ParseNodeRewriter.java|  25 +++
 .../org/apache/phoenix/util/ParseNodeUtil.java | 142 
 .../java/org/apache/phoenix/util/SchemaUtil.java   |  13 +-
 .../phoenix/compile/JoinQueryCompilerTest.java |  31 +--
 .../apache/phoenix/compile/QueryCompilerTest.java  | 237 -
 .../java/org/apache/phoenix/util/TestUtil.java |  28 +++
 10 files changed, 782 insertions(+), 115 deletions(-)

diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
index 0bdc748..98a58a9 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
@@ -231,6 +231,22 @@ public class FromCompiler {
 return visitor;
 }
 
+/**
+ * Refresh the inner state of {@link MultiTableColumnResolver} for the 
derivedTableNode when
+ * the derivedTableNode is changed for some sql optimization.
+ * @param columnResolver
+ * @param derivedTableNode
+ * @return
+ * @throws SQLException
+ */
+public static TableRef refreshDerivedTableNode(
+ColumnResolver columnResolver, DerivedTableNode derivedTableNode) 
throws SQLException {
+if(!(columnResolver instanceof MultiTableColumnResolver)) {
+throw new UnsupportedOperationException();
+}
+return 
((MultiTableColumnResolver)columnResolver).refreshDerivedTableNode(derivedTableNode);
+}
+
 public static ColumnResolver getResolverForSchema(UseSchemaStatement 
statement, PhoenixConnection connection)
 throws SQLException {
 return new SchemaResolver(connection, 
SchemaUtil.normalizeIdentifier(statement.getSchemaName()), true);
@@ -899,6 +915,23 @@ public class FromCompiler {
 return null;
 }
 
+/**
+ * Invoke the {@link #visit(DerivedTableNode)} again to refresh the 
inner state.
+ * @param derivedTableNode
+ * @return
+ * @throws SQLException
+ */
+public TableRef refreshDerivedTableNode(DerivedTableNode 
derivedTableNode) throws SQLException {
+  String tableAlias = derivedTableNode.getAlias();
+  List removedTableRefs = 
this.tableMap.removeAll(tableAlias);
+  if(removedTableRefs == null || removedTableRefs.isEmpty()) {
+  return null;
+  }
+  tables.removeAll(removedTableRefs);
+  this.visit(derivedTableNode);
+  return this.resolveTable(null, tableAlias);
+}
+
 private static class ColumnFamilyRef {
 private final TableRef tableRef;
 private final PColumnFamily family;
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
index f932a32..f0a2f36 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
@@ -52,7 +52,6 @@ import org.apache.phoenix.parse.AndBooleanParseNodeVisitor;
 import org.apache.phoenix.parse.AndParseNode;
 import org.apache.phoenix.parse.AndRewriterBooleanParseNodeVisitor;
 import org.apache.phoenix.parse.BindTableNode;
-import org.apache.phoenix.parse.BooleanParseNodeVisitor;
 import org.apache.phoenix.parse.ColumnDef;
 import org.apache.phoenix.parse.ColumnParseNode;
 import org.apache.phoenix.parse.ComparisonParseNode;
@@ -100,6 +99,7 @@ import org.apache.phoenix.schema.types.PVarbinary;
 import org.apache.phoenix.schema.types.PVarchar;
 import org.apache.phoenix.util.EncodedColumnsUtil;
 import org.apache.phoenix.util.IndexUtil;
+import org.apache.phoenix.util.ParseNodeUtil;
 import org.apache.phoenix.util.SchemaUtil;
 
 import com.google.common.base.Preconditions;
@@ -138,6 +138,16 @@ public class JoinCompiler {
 this.useSortMergeJoin = 
select.getHint().hasHint(Hint.USE_SORT_MERGE_JOIN);
 }
 
+/**
+ * After this method is called, the inner state of the parameter resolver 
may be changed b

[phoenix] branch 4.x-HBase-1.4 updated: PHOENIX-5451 Column pruning for Subselect

2019-09-05 Thread chenglei
This is an automated email from the ASF dual-hosted git repository.

chenglei pushed a commit to branch 4.x-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push:
 new 379974c  PHOENIX-5451 Column pruning for Subselect
379974c is described below

commit 379974ca7bc12e11c62e7a6082476a35bb55059f
Author: chenglei 
AuthorDate: Thu Sep 5 15:37:18 2019 +0800

PHOENIX-5451 Column pruning for Subselect
---
 .../org/apache/phoenix/compile/FromCompiler.java   |  33 +++
 .../org/apache/phoenix/compile/JoinCompiler.java   | 157 ++
 .../apache/phoenix/compile/SubselectRewriter.java  | 214 +++
 .../apache/phoenix/optimize/QueryOptimizer.java|  17 +-
 .../apache/phoenix/parse/ParseNodeRewriter.java|  25 +++
 .../org/apache/phoenix/util/ParseNodeUtil.java | 142 
 .../java/org/apache/phoenix/util/SchemaUtil.java   |  13 +-
 .../phoenix/compile/JoinQueryCompilerTest.java |  31 +--
 .../apache/phoenix/compile/QueryCompilerTest.java  | 237 -
 .../java/org/apache/phoenix/util/TestUtil.java |  28 +++
 10 files changed, 782 insertions(+), 115 deletions(-)

diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
index 0bdc748..98a58a9 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
@@ -231,6 +231,22 @@ public class FromCompiler {
 return visitor;
 }
 
+/**
+ * Refresh the inner state of {@link MultiTableColumnResolver} for the 
derivedTableNode when
+ * the derivedTableNode is changed for some sql optimization.
+ * @param columnResolver
+ * @param derivedTableNode
+ * @return
+ * @throws SQLException
+ */
+public static TableRef refreshDerivedTableNode(
+ColumnResolver columnResolver, DerivedTableNode derivedTableNode) 
throws SQLException {
+if(!(columnResolver instanceof MultiTableColumnResolver)) {
+throw new UnsupportedOperationException();
+}
+return 
((MultiTableColumnResolver)columnResolver).refreshDerivedTableNode(derivedTableNode);
+}
+
 public static ColumnResolver getResolverForSchema(UseSchemaStatement 
statement, PhoenixConnection connection)
 throws SQLException {
 return new SchemaResolver(connection, 
SchemaUtil.normalizeIdentifier(statement.getSchemaName()), true);
@@ -899,6 +915,23 @@ public class FromCompiler {
 return null;
 }
 
+/**
+ * Invoke the {@link #visit(DerivedTableNode)} again to refresh the 
inner state.
+ * @param derivedTableNode
+ * @return
+ * @throws SQLException
+ */
+public TableRef refreshDerivedTableNode(DerivedTableNode 
derivedTableNode) throws SQLException {
+  String tableAlias = derivedTableNode.getAlias();
+  List removedTableRefs = 
this.tableMap.removeAll(tableAlias);
+  if(removedTableRefs == null || removedTableRefs.isEmpty()) {
+  return null;
+  }
+  tables.removeAll(removedTableRefs);
+  this.visit(derivedTableNode);
+  return this.resolveTable(null, tableAlias);
+}
+
 private static class ColumnFamilyRef {
 private final TableRef tableRef;
 private final PColumnFamily family;
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
index f932a32..f0a2f36 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
@@ -52,7 +52,6 @@ import org.apache.phoenix.parse.AndBooleanParseNodeVisitor;
 import org.apache.phoenix.parse.AndParseNode;
 import org.apache.phoenix.parse.AndRewriterBooleanParseNodeVisitor;
 import org.apache.phoenix.parse.BindTableNode;
-import org.apache.phoenix.parse.BooleanParseNodeVisitor;
 import org.apache.phoenix.parse.ColumnDef;
 import org.apache.phoenix.parse.ColumnParseNode;
 import org.apache.phoenix.parse.ComparisonParseNode;
@@ -100,6 +99,7 @@ import org.apache.phoenix.schema.types.PVarbinary;
 import org.apache.phoenix.schema.types.PVarchar;
 import org.apache.phoenix.util.EncodedColumnsUtil;
 import org.apache.phoenix.util.IndexUtil;
+import org.apache.phoenix.util.ParseNodeUtil;
 import org.apache.phoenix.util.SchemaUtil;
 
 import com.google.common.base.Preconditions;
@@ -138,6 +138,16 @@ public class JoinCompiler {
 this.useSortMergeJoin = 
select.getHint().hasHint(Hint.USE_SORT_MERGE_JOIN);
 }
 
+/**
+ * After this method is called, the inner state of the parameter resolver 
may be changed b