phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
Repository: phoenix Updated Branches: refs/heads/master 58415e2f3 -> 28b9de0da 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/28b9de0d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/28b9de0d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/28b9de0d Branch: refs/heads/master Commit: 28b9de0da01b61e61c749ed433ddb995596b3e45 Parents: 58415e2 Author: maryannxue Authored: Fri May 18 19:46:29 2018 -0700 Committer: maryannxue Committed: Fri May 18 19:46:29 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/28b9de0d/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/28b9de0d/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 compile(StatementContext context, FilterableStatement statement, ParseNode viewWhere, Li
phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
Repository: phoenix Updated Branches: refs/heads/5.x-HBase-2.0 87ab023de -> 9b921b294 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/9b921b29 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/9b921b29 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/9b921b29 Branch: refs/heads/5.x-HBase-2.0 Commit: 9b921b2945cdb64822f8d83e7acb52458e762c9d Parents: 87ab023 Author: maryannxue Authored: Mon May 21 10:07:27 2018 -0700 Committer: maryannxue Committed: Mon May 21 10:07:27 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/9b921b29/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 c4e4a9e..e823559 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 @@ -564,4 +564,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/9b921b29/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 compile(StatementContext context, FilterableStatement statement, ParseNode
phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.3 9066ce395 -> b11650082 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/b1165008 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/b1165008 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/b1165008 Branch: refs/heads/4.x-HBase-1.3 Commit: b1165008230e212cfec1e52d86c6945176ad1d60 Parents: 9066ce3 Author: maryannxue Authored: Mon May 21 10:10:23 2018 -0700 Committer: maryannxue Committed: Mon May 21 10:10:23 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/b1165008/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/b1165008/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 compile(StatementContext context, FilterableStatement statement, ParseNode
phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.2 8e012d013 -> eae096c28 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/eae096c2 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/eae096c2 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/eae096c2 Branch: refs/heads/4.x-HBase-1.2 Commit: eae096c288d3f174ba66214bf29c2c6e272db57d Parents: 8e012d0 Author: maryannxue Authored: Mon May 21 10:19:30 2018 -0700 Committer: maryannxue Committed: Mon May 21 10:19:30 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/eae096c2/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/eae096c2/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 compile(StatementContext context, FilterableStatement statement, ParseNode
phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.1 272a7e6bb -> e3b0579b2 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/e3b0579b Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/e3b0579b Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/e3b0579b Branch: refs/heads/4.x-HBase-1.1 Commit: e3b0579b21778c0303900e263f5d1e750c983804 Parents: 272a7e6 Author: maryannxue Authored: Mon May 21 11:05:45 2018 -0700 Committer: maryannxue Committed: Mon May 21 11:05:45 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/e3b0579b/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/e3b0579b/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 compile(StatementContext context, FilterableStatement statement, ParseNode
phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 2f35fe306 -> 097881c3f 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/097881c3 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/097881c3 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/097881c3 Branch: refs/heads/4.x-HBase-0.98 Commit: 097881c3fad5bb746d2a58ae3f90d52d40121cfc Parents: 2f35fe3 Author: maryannxue Authored: Mon May 21 11:07:52 2018 -0700 Committer: maryannxue Committed: Mon May 21 11:07:52 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/097881c3/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/097881c3/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 compile(StatementContext context, FilterableStatement statement, ParseNo
phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
Repository: phoenix Updated Branches: refs/heads/4.x-cdh5.14 6d7bb2ed1 -> 07b6ad8c9 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/07b6ad8c Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/07b6ad8c Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/07b6ad8c Branch: refs/heads/4.x-cdh5.14 Commit: 07b6ad8c92cc62ad9330d029021c393dffda7aac Parents: 6d7bb2e Author: maryannxue Authored: Mon May 21 11:11:53 2018 -0700 Committer: maryannxue Committed: Mon May 21 11:11:53 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/07b6ad8c/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/07b6ad8c/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 compile(StatementContext context, FilterableStatement statement, ParseNode vie
phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
Repository: phoenix Updated Branches: refs/heads/4.x-cdh5.13 11a9b2472 -> f7211eaf7 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/f7211eaf Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/f7211eaf Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/f7211eaf Branch: refs/heads/4.x-cdh5.13 Commit: f7211eaf7d16c780b37df5a4d531d789d18dbcd7 Parents: 11a9b24 Author: maryannxue Authored: Mon May 21 11:13:59 2018 -0700 Committer: maryannxue Committed: Mon May 21 11:13:59 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/f7211eaf/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/f7211eaf/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 compile(StatementContext context, FilterableStatement statement, ParseNode vie
phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
Repository: phoenix Updated Branches: refs/heads/4.x-cdh5.12 acde89ffb -> ef5e6112a 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/ef5e6112 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ef5e6112 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ef5e6112 Branch: refs/heads/4.x-cdh5.12 Commit: ef5e6112a7d821189055bb6639e0dd8f65107ab9 Parents: acde89f Author: maryannxue Authored: Mon May 21 11:16:19 2018 -0700 Committer: maryannxue Committed: Mon May 21 11:16:19 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/ef5e6112/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/ef5e6112/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 compile(StatementContext context, FilterableStatement statement, ParseNode vie
phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
Repository: phoenix Updated Branches: refs/heads/4.x-cdh5.11 c2d6bc17a -> 574d8188a 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.11 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 compile(StatementContext context, FilterableStatement statement, ParseNode vie
[05/24] phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
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/b1165008 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/b1165008 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/b1165008 Branch: refs/heads/omid2 Commit: b1165008230e212cfec1e52d86c6945176ad1d60 Parents: 9066ce3 Author: maryannxue Authored: Mon May 21 10:10:23 2018 -0700 Committer: maryannxue Committed: Mon May 21 10:10:23 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/b1165008/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/b1165008/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 compile(StatementContext context, FilterableStatement statement, ParseNode viewWhere, List dynamicFilters, Set subqueryNodes) throws SQLException { ParseNode wher
[05/50] [abbrv] phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
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/28b9de0d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/28b9de0d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/28b9de0d Branch: refs/heads/4.x-HBase-1.4 Commit: 28b9de0da01b61e61c749ed433ddb995596b3e45 Parents: 58415e2 Author: maryannxue Authored: Fri May 18 19:46:29 2018 -0700 Committer: maryannxue Committed: Fri May 18 19:46:29 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/28b9de0d/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/28b9de0d/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 compile(StatementContext context, FilterableStatement statement, ParseNode viewWhere, List dynamicFilters, Set subqueryNodes) throws SQLException { ParseN
[20/50] [abbrv] phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan
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/b1165008 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/b1165008 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/b1165008 Branch: refs/heads/4.14-HBase-1.3 Commit: b1165008230e212cfec1e52d86c6945176ad1d60 Parents: 9066ce3 Author: maryannxue Authored: Mon May 21 10:10:23 2018 -0700 Committer: maryannxue Committed: Mon May 21 10:10:23 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/b1165008/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/b1165008/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 compile(StatementContext context, FilterableStatement statement, ParseNode viewWhere, List dynamicFilters, Set subqueryNodes) throws SQLException { Parse
[1/6] phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan [Forced Update!]
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 compile(StatementContext context, FilterableStatement statemen
[1/6] phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan [Forced Update!]
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 compile(StatementContext context, FilterableStatement statemen
[1/6] phoenix git commit: PHOENIX-4692 ArrayIndexOutOfBoundsException in ScanRanges.intersectScan [Forced Update!]
Repository: phoenix Updated Branches: refs/heads/4.x-cdh5.14 07b6ad8c9 -> c7e9c1955 (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.14 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 compile(StatementContext context, FilterableStatement statemen