[1/6] phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan [Forced Update!]

2018-05-25 Thread pboado
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.13 f7211eaf7 -> 79c8a6637 (forced update)


PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan


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

Branch: refs/heads/4.x-cdh5.13
Commit: 574d8188af859dc2d0467b681c7b88bd83f27dda
Parents: c2d6bc1
Author: maryannxue 
Authored: Mon May 21 11:17:46 2018 -0700
Committer: maryannxue 
Committed: Mon May 21 11:17:46 2018 -0700

--
 .../apache/phoenix/end2end/SkipScanQueryIT.java | 21 
 .../apache/phoenix/compile/WhereCompiler.java   | 12 +--
 .../apache/phoenix/execute/BaseQueryPlan.java   |  2 +-
 .../apache/phoenix/execute/HashJoinPlan.java|  5 -
 4 files changed, 32 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/574d8188/phoenix-core/src/it/java/org/apache/phoenix/end2end/SkipScanQueryIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SkipScanQueryIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SkipScanQueryIT.java
index d98bbe2..fb0b568 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SkipScanQueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SkipScanQueryIT.java
@@ -563,4 +563,25 @@ public class SkipScanQueryIT extends 
ParallelStatsDisabledIT {
 assertFalse(rs.next());
 }
 }
+
+@Test
+public void testSkipScanJoinOptimization() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+String tableName = generateUniqueName();
+String viewName = generateUniqueName();
+String idxName = "IDX_" + tableName;
+conn.setAutoCommit(true);
+conn.createStatement().execute(
+"create table " + tableName + " (PK1 INTEGER NOT NULL, PK2 
INTEGER NOT NULL, " +
+" ID1 INTEGER, ID2 INTEGER CONSTRAINT PK PRIMARY 
KEY(PK1 , PK2))SALT_BUCKETS = 4");
+conn.createStatement().execute("upsert into " + tableName + " 
values (1,1,1,1)");
+conn.createStatement().execute("upsert into " + tableName + " 
values (2,2,2,2)");
+conn.createStatement().execute("upsert into " + tableName + " 
values (2,3,1,2)");
+conn.createStatement().execute("create view " + viewName + " as 
select * from " +
+tableName + " where PK1 in (1,2)");
+conn.createStatement().execute("create index " + idxName + " on " 
+ viewName + " (ID1)");
+ResultSet rs = conn.createStatement().executeQuery("select /*+ 
INDEX(" + viewName + " " + idxName + ") */ * from " + viewName + " where ID1 = 
1 ");
+assertTrue(rs.next());
+}
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/574d8188/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereCompiler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereCompiler.java
index 2cf5857..832b1f0 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereCompiler.java
@@ -105,9 +105,9 @@ public class WhereCompiler {
  * @throws AmbiguousColumnException if an unaliased column name is 
ambiguous across multiple tables
  */
 public static Expression compile(StatementContext context, 
FilterableStatement statement, ParseNode viewWhere, Set 
subqueryNodes) throws SQLException {
-return compile(context, statement, viewWhere, 
Collections.emptyList(), false, subqueryNodes);
+return compile(context, statement, viewWhere, 
Collections.emptyList(), subqueryNodes);
 }
-
+
 /**
  * Optimize scan ranges by applying dynamically generated filter 
expressions.
  * @param context the shared context during query compilation
@@ -118,7 +118,7 @@ public class WhereCompiler {
  * @throws ColumnNotFoundException if column name could not be resolved
  * @throws AmbiguousColumnException if an unaliased column name is 
ambiguous across multiple tables
  */
-public static Expression compile(StatementContext context, 
FilterableStatement statement, ParseNode viewWhere, List 
dynamicFilters, boolean hashJoinOptimization, Set 
subqueryNodes) throws SQLException {
+public static Expression 

[1/6] phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan [Forced Update!]

2018-05-25 Thread pboado
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.12 ef5e6112a -> 4e3295017 (forced update)


PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan


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

Branch: refs/heads/4.x-cdh5.12
Commit: 574d8188af859dc2d0467b681c7b88bd83f27dda
Parents: c2d6bc1
Author: maryannxue 
Authored: Mon May 21 11:17:46 2018 -0700
Committer: maryannxue 
Committed: Mon May 21 11:17:46 2018 -0700

--
 .../apache/phoenix/end2end/SkipScanQueryIT.java | 21 
 .../apache/phoenix/compile/WhereCompiler.java   | 12 +--
 .../apache/phoenix/execute/BaseQueryPlan.java   |  2 +-
 .../apache/phoenix/execute/HashJoinPlan.java|  5 -
 4 files changed, 32 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/574d8188/phoenix-core/src/it/java/org/apache/phoenix/end2end/SkipScanQueryIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SkipScanQueryIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SkipScanQueryIT.java
index d98bbe2..fb0b568 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SkipScanQueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SkipScanQueryIT.java
@@ -563,4 +563,25 @@ public class SkipScanQueryIT extends 
ParallelStatsDisabledIT {
 assertFalse(rs.next());
 }
 }
+
+@Test
+public void testSkipScanJoinOptimization() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+String tableName = generateUniqueName();
+String viewName = generateUniqueName();
+String idxName = "IDX_" + tableName;
+conn.setAutoCommit(true);
+conn.createStatement().execute(
+"create table " + tableName + " (PK1 INTEGER NOT NULL, PK2 
INTEGER NOT NULL, " +
+" ID1 INTEGER, ID2 INTEGER CONSTRAINT PK PRIMARY 
KEY(PK1 , PK2))SALT_BUCKETS = 4");
+conn.createStatement().execute("upsert into " + tableName + " 
values (1,1,1,1)");
+conn.createStatement().execute("upsert into " + tableName + " 
values (2,2,2,2)");
+conn.createStatement().execute("upsert into " + tableName + " 
values (2,3,1,2)");
+conn.createStatement().execute("create view " + viewName + " as 
select * from " +
+tableName + " where PK1 in (1,2)");
+conn.createStatement().execute("create index " + idxName + " on " 
+ viewName + " (ID1)");
+ResultSet rs = conn.createStatement().executeQuery("select /*+ 
INDEX(" + viewName + " " + idxName + ") */ * from " + viewName + " where ID1 = 
1 ");
+assertTrue(rs.next());
+}
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/574d8188/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereCompiler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereCompiler.java
index 2cf5857..832b1f0 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereCompiler.java
@@ -105,9 +105,9 @@ public class WhereCompiler {
  * @throws AmbiguousColumnException if an unaliased column name is 
ambiguous across multiple tables
  */
 public static Expression compile(StatementContext context, 
FilterableStatement statement, ParseNode viewWhere, Set 
subqueryNodes) throws SQLException {
-return compile(context, statement, viewWhere, 
Collections.emptyList(), false, subqueryNodes);
+return compile(context, statement, viewWhere, 
Collections.emptyList(), subqueryNodes);
 }
-
+
 /**
  * Optimize scan ranges by applying dynamically generated filter 
expressions.
  * @param context the shared context during query compilation
@@ -118,7 +118,7 @@ public class WhereCompiler {
  * @throws ColumnNotFoundException if column name could not be resolved
  * @throws AmbiguousColumnException if an unaliased column name is 
ambiguous across multiple tables
  */
-public static Expression compile(StatementContext context, 
FilterableStatement statement, ParseNode viewWhere, List 
dynamicFilters, boolean hashJoinOptimization, Set 
subqueryNodes) throws SQLException {
+public static Expression