git commit: PHOENIX-1211 Use skip scan when row value constructor uses leading row key columns (Kyle Buzsaki)
Repository: phoenix Updated Branches: refs/heads/4.0 7cdc43770 - 3ebcbd76c PHOENIX-1211 Use skip scan when row value constructor uses leading row key columns (Kyle Buzsaki) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/3ebcbd76 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3ebcbd76 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3ebcbd76 Branch: refs/heads/4.0 Commit: 3ebcbd76cb5b83111f56372de1900c19a7c9e220 Parents: 7cdc437 Author: James Taylor jamestay...@apache.org Authored: Fri Sep 12 17:21:14 2014 -0700 Committer: James Taylor jamestay...@apache.org Committed: Fri Sep 12 17:21:14 2014 -0700 -- .../org/apache/phoenix/end2end/InListIT.java| 24 +--- .../phoenix/end2end/RowValueConstructorIT.java | 53 + .../org/apache/phoenix/compile/ScanRanges.java | 6 +- .../apache/phoenix/compile/WhereCompiler.java | 4 +- .../apache/phoenix/compile/WhereOptimizer.java | 6 -- .../apache/phoenix/filter/SkipScanFilter.java | 55 +++-- .../org/apache/phoenix/schema/RowKeySchema.java | 62 ++-- .../java/org/apache/phoenix/util/ScanUtil.java | 39 +--- .../phoenix/compile/WhereOptimizerTest.java | 4 +- 9 files changed, 202 insertions(+), 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/3ebcbd76/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java index 524d494..dc60b69 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java @@ -164,6 +164,11 @@ public class InListIT extends BaseHBaseManagedTimeIT { private static final ListBoolean TENANCIES = Arrays.asList(false, true); private static final ListPDataType INTEGER_TYPES = Arrays.asList(PDataType.INTEGER, PDataType.LONG); private static final ListInteger SALT_BUCKET_NUMBERS = Arrays.asList(0, 4); + +// we should be including the RANGE_SCAN hint here, but a bug with ParallelIterators causes tests to fail +// see the relevant JIRA here: https://issues.apache.org/jira/browse/PHOENIX-1251 +private static final ListString HINTS = Arrays.asList(, /*+ SKIP_SCAN */); +//private static final ListString HINTS = Arrays.asList(, /*+ SKIP_SCAN */, /*+ RANGE_SCAN */); /** * Tests the given where clause against the given upserts by comparing against the list of @@ -193,14 +198,19 @@ public class InListIT extends BaseHBaseManagedTimeIT { } conn.commit(); -// perform the query -String sql = SELECT nonPk FROM + tableName + + whereClause; -ResultSet rs = conn.createStatement().executeQuery(sql); -for(String expected : expecteds) { -assertTrue(rs.next()); -assertEquals(expected, rs.getString(1)); +for(String hint : HINTS) { +String context = where: + whereClause + , type: + pkType + , salt buckets: ++ saltBuckets + , multitenant: + isMultiTenant + , hint: + hint + ; + +// perform the query +String sql = SELECT + hint + nonPk FROM + tableName + + whereClause; +ResultSet rs = conn.createStatement().executeQuery(sql); +for (String expected : expecteds) { +assertTrue(did not include result ' + expected + ' ( + context + ), rs.next()); +assertEquals(context, expected, rs.getString(1)); +} +assertFalse(context, rs.next()); } -assertFalse(rs.next()); } } } http://git-wip-us.apache.org/repos/asf/phoenix/blob/3ebcbd76/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java index 041725c..bf3d9db 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java @@ -53,6 +53,7 @@
git commit: PHOENIX-1211 Use skip scan when row value constructor uses leading row key columns (Kyle Buzsaki)
Repository: phoenix Updated Branches: refs/heads/master 08d9b98f3 - c51dc12b0 PHOENIX-1211 Use skip scan when row value constructor uses leading row key columns (Kyle Buzsaki) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/c51dc12b Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/c51dc12b Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/c51dc12b Branch: refs/heads/master Commit: c51dc12b07276ed318982b170446b6867fa12521 Parents: 08d9b98 Author: James Taylor jamestay...@apache.org Authored: Fri Sep 12 17:21:14 2014 -0700 Committer: James Taylor jamestay...@apache.org Committed: Fri Sep 12 17:23:47 2014 -0700 -- .../org/apache/phoenix/end2end/InListIT.java| 24 +--- .../phoenix/end2end/RowValueConstructorIT.java | 53 + .../org/apache/phoenix/compile/ScanRanges.java | 6 +- .../apache/phoenix/compile/WhereCompiler.java | 4 +- .../apache/phoenix/compile/WhereOptimizer.java | 6 -- .../apache/phoenix/filter/SkipScanFilter.java | 55 +++-- .../org/apache/phoenix/schema/RowKeySchema.java | 62 ++-- .../java/org/apache/phoenix/util/ScanUtil.java | 39 +--- .../phoenix/compile/WhereOptimizerTest.java | 4 +- 9 files changed, 202 insertions(+), 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/c51dc12b/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java index c257ccb..fefa2e2 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java @@ -147,6 +147,11 @@ public class InListIT extends BaseHBaseManagedTimeIT { private static final ListBoolean TENANCIES = Arrays.asList(false, true); private static final ListPDataType INTEGER_TYPES = Arrays.asList(PDataType.INTEGER, PDataType.LONG); private static final ListInteger SALT_BUCKET_NUMBERS = Arrays.asList(0, 4); + +// we should be including the RANGE_SCAN hint here, but a bug with ParallelIterators causes tests to fail +// see the relevant JIRA here: https://issues.apache.org/jira/browse/PHOENIX-1251 +private static final ListString HINTS = Arrays.asList(, /*+ SKIP_SCAN */); +//private static final ListString HINTS = Arrays.asList(, /*+ SKIP_SCAN */, /*+ RANGE_SCAN */); /** * Tests the given where clause against the given upserts by comparing against the list of @@ -176,14 +181,19 @@ public class InListIT extends BaseHBaseManagedTimeIT { } conn.commit(); -// perform the query -String sql = SELECT nonPk FROM + tableName + + whereClause; -ResultSet rs = conn.createStatement().executeQuery(sql); -for(String expected : expecteds) { -assertTrue(rs.next()); -assertEquals(expected, rs.getString(1)); +for(String hint : HINTS) { +String context = where: + whereClause + , type: + pkType + , salt buckets: ++ saltBuckets + , multitenant: + isMultiTenant + , hint: + hint + ; + +// perform the query +String sql = SELECT + hint + nonPk FROM + tableName + + whereClause; +ResultSet rs = conn.createStatement().executeQuery(sql); +for (String expected : expecteds) { +assertTrue(did not include result ' + expected + ' ( + context + ), rs.next()); +assertEquals(context, expected, rs.getString(1)); +} +assertFalse(context, rs.next()); } -assertFalse(rs.next()); } } } http://git-wip-us.apache.org/repos/asf/phoenix/blob/c51dc12b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java index 041725c..bf3d9db 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java @@ -53,6
git commit: PHOENIX-1211 Use skip scan when row value constructor uses leading row key columns (Kyle Buzsaki)
Repository: phoenix Updated Branches: refs/heads/3.0 b6341d9aa - f22dffc13 PHOENIX-1211 Use skip scan when row value constructor uses leading row key columns (Kyle Buzsaki) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/f22dffc1 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/f22dffc1 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/f22dffc1 Branch: refs/heads/3.0 Commit: f22dffc1375429420e94b96e8d984a6f31cbc618 Parents: b6341d9 Author: James Taylor jamestay...@apache.org Authored: Fri Sep 12 17:34:53 2014 -0700 Committer: James Taylor jamestay...@apache.org Committed: Fri Sep 12 17:34:53 2014 -0700 -- .../org/apache/phoenix/end2end/InListIT.java| 24 +--- .../phoenix/end2end/RowValueConstructorIT.java | 53 + .../org/apache/phoenix/compile/ScanRanges.java | 6 +- .../apache/phoenix/compile/WhereCompiler.java | 4 +- .../apache/phoenix/compile/WhereOptimizer.java | 6 -- .../apache/phoenix/filter/SkipScanFilter.java | 49 ++-- .../org/apache/phoenix/schema/RowKeySchema.java | 62 ++-- .../java/org/apache/phoenix/util/ScanUtil.java | 39 +--- .../phoenix/compile/WhereOptimizerTest.java | 4 +- 9 files changed, 196 insertions(+), 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/f22dffc1/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java index 524d494..dc60b69 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java @@ -164,6 +164,11 @@ public class InListIT extends BaseHBaseManagedTimeIT { private static final ListBoolean TENANCIES = Arrays.asList(false, true); private static final ListPDataType INTEGER_TYPES = Arrays.asList(PDataType.INTEGER, PDataType.LONG); private static final ListInteger SALT_BUCKET_NUMBERS = Arrays.asList(0, 4); + +// we should be including the RANGE_SCAN hint here, but a bug with ParallelIterators causes tests to fail +// see the relevant JIRA here: https://issues.apache.org/jira/browse/PHOENIX-1251 +private static final ListString HINTS = Arrays.asList(, /*+ SKIP_SCAN */); +//private static final ListString HINTS = Arrays.asList(, /*+ SKIP_SCAN */, /*+ RANGE_SCAN */); /** * Tests the given where clause against the given upserts by comparing against the list of @@ -193,14 +198,19 @@ public class InListIT extends BaseHBaseManagedTimeIT { } conn.commit(); -// perform the query -String sql = SELECT nonPk FROM + tableName + + whereClause; -ResultSet rs = conn.createStatement().executeQuery(sql); -for(String expected : expecteds) { -assertTrue(rs.next()); -assertEquals(expected, rs.getString(1)); +for(String hint : HINTS) { +String context = where: + whereClause + , type: + pkType + , salt buckets: ++ saltBuckets + , multitenant: + isMultiTenant + , hint: + hint + ; + +// perform the query +String sql = SELECT + hint + nonPk FROM + tableName + + whereClause; +ResultSet rs = conn.createStatement().executeQuery(sql); +for (String expected : expecteds) { +assertTrue(did not include result ' + expected + ' ( + context + ), rs.next()); +assertEquals(context, expected, rs.getString(1)); +} +assertFalse(context, rs.next()); } -assertFalse(rs.next()); } } } http://git-wip-us.apache.org/repos/asf/phoenix/blob/f22dffc1/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java index 041725c..bf3d9db 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java @@ -53,6 +53,7 @@