[04/50] [abbrv] phoenix git commit: PHOENIX-2647 Duplicate results in reverse scan when guideposts are traversed (Ankit Singhal)

2016-02-24 Thread maryannxue
PHOENIX-2647 Duplicate results in reverse scan when guideposts are traversed 
(Ankit Singhal)


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

Branch: refs/heads/calcite
Commit: b64edb75455d56fc2a5086043bdd6fa1064f2ca7
Parents: a82a0ff
Author: Ankit Singhal 
Authored: Fri Feb 5 23:45:04 2016 +0530
Committer: Ankit Singhal 
Committed: Fri Feb 5 23:45:04 2016 +0530

--
 .../apache/phoenix/end2end/ReverseScanIT.java   | 21 +
 .../phoenix/end2end/StatsCollectorIT.java   | 28 +++
 .../java/org/apache/phoenix/util/ScanUtil.java  | 49 ++--
 3 files changed, 64 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b64edb75/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
index 35a8025..2722be1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
@@ -168,6 +168,27 @@ public class ReverseScanIT extends BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testReverseScanForSpecificRangeInRegion() throws Exception {
+Connection conn;
+ResultSet rs;
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+conn = DriverManager.getConnection(getUrl(), props);
+conn.createStatement()
+.execute("CREATE TABLE T" + " ( k VARCHAR, c1.a bigint,c2.b 
bigint CONSTRAINT pk PRIMARY KEY (k)) ");
+conn.createStatement().execute("upsert into T values ('a',1,3)");
+conn.createStatement().execute("upsert into T values ('b',1,3)");
+conn.createStatement().execute("upsert into T values ('c',1,3)");
+conn.createStatement().execute("upsert into T values ('d',1,3)");
+conn.createStatement().execute("upsert into T values ('e',1,3)");
+conn.commit();
+rs = conn.createStatement().executeQuery("SELECT k FROM T where k>'b' 
and k<'d' order by k desc");
+assertTrue(rs.next());
+assertEquals("c", rs.getString(1));
+assertTrue(!rs.next());
+conn.close();
+}
+
+@Test
 public void testReverseScanIndex() throws Exception {
 String tenantId = getOrganizationId();
 initATableValues(tenantId, getSplitsAtRowKeys(tenantId), getUrl());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b64edb75/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
index caba259..4450152 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
@@ -123,31 +123,41 @@ public class StatsCollectorIT extends 
StatsCollectorAbstractIT {
 conn.close();
 }
 
-@Test
-public void testNoDuplicatesAfterUpdateStats() throws Throwable {
+private void testNoDuplicatesAfterUpdateStats(String splitKey) throws 
Throwable {
 Connection conn;
 PreparedStatement stmt;
 ResultSet rs;
 Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement()
-.execute("CREATE TABLE " + fullTableName +" ( k VARCHAR, c1.a 
bigint,c2.b bigint CONSTRAINT pk PRIMARY KEY (k))" + tableDDLOptions );
-conn.createStatement().execute("upsert into " + fullTableName +" 
values ('abc',1,3)");
-conn.createStatement().execute("upsert into " + fullTableName +" 
values ('def',2,4)");
+.execute("CREATE TABLE " + fullTableName
++ " ( k VARCHAR, c1.a bigint,c2.b bigint CONSTRAINT pk 
PRIMARY KEY (k)) "
++ (splitKey != null ? "split on (" + splitKey + ")" : 
""));
+conn.createStatement().execute("upsert into " + fullTableName + " 
values ('abc',1,3)");
+conn.createStatement().execute("upsert into " + fullTableName + " 
values ('def',2,4)");
 conn.commit();
-// CAll the update statistics query here
 stmt = conn.prepareStatement("UPDATE STATISTICS " + fullTableName);
 

phoenix git commit: PHOENIX-2647 Duplicate results in reverse scan when guideposts are traversed (Ankit Singhal)

2016-02-05 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 650ae264d -> 7bbca60c4


PHOENIX-2647 Duplicate results in reverse scan when guideposts are traversed 
(Ankit Singhal)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 7bbca60c4a1add594d37e50107a1a7613bdd59bf
Parents: 650ae26
Author: Ankit Singhal 
Authored: Fri Feb 5 23:41:36 2016 +0530
Committer: Ankit Singhal 
Committed: Fri Feb 5 23:41:36 2016 +0530

--
 .../apache/phoenix/end2end/ReverseScanIT.java   | 21 +
 .../phoenix/end2end/StatsCollectorIT.java   | 28 +++
 .../java/org/apache/phoenix/util/ScanUtil.java  | 49 ++--
 3 files changed, 64 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7bbca60c/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
index 35a8025..2722be1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
@@ -168,6 +168,27 @@ public class ReverseScanIT extends BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testReverseScanForSpecificRangeInRegion() throws Exception {
+Connection conn;
+ResultSet rs;
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+conn = DriverManager.getConnection(getUrl(), props);
+conn.createStatement()
+.execute("CREATE TABLE T" + " ( k VARCHAR, c1.a bigint,c2.b 
bigint CONSTRAINT pk PRIMARY KEY (k)) ");
+conn.createStatement().execute("upsert into T values ('a',1,3)");
+conn.createStatement().execute("upsert into T values ('b',1,3)");
+conn.createStatement().execute("upsert into T values ('c',1,3)");
+conn.createStatement().execute("upsert into T values ('d',1,3)");
+conn.createStatement().execute("upsert into T values ('e',1,3)");
+conn.commit();
+rs = conn.createStatement().executeQuery("SELECT k FROM T where k>'b' 
and k<'d' order by k desc");
+assertTrue(rs.next());
+assertEquals("c", rs.getString(1));
+assertTrue(!rs.next());
+conn.close();
+}
+
+@Test
 public void testReverseScanIndex() throws Exception {
 String tenantId = getOrganizationId();
 initATableValues(tenantId, getSplitsAtRowKeys(tenantId), getUrl());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/7bbca60c/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
index caba259..4450152 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
@@ -123,31 +123,41 @@ public class StatsCollectorIT extends 
StatsCollectorAbstractIT {
 conn.close();
 }
 
-@Test
-public void testNoDuplicatesAfterUpdateStats() throws Throwable {
+private void testNoDuplicatesAfterUpdateStats(String splitKey) throws 
Throwable {
 Connection conn;
 PreparedStatement stmt;
 ResultSet rs;
 Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement()
-.execute("CREATE TABLE " + fullTableName +" ( k VARCHAR, c1.a 
bigint,c2.b bigint CONSTRAINT pk PRIMARY KEY (k))" + tableDDLOptions );
-conn.createStatement().execute("upsert into " + fullTableName +" 
values ('abc',1,3)");
-conn.createStatement().execute("upsert into " + fullTableName +" 
values ('def',2,4)");
+.execute("CREATE TABLE " + fullTableName
++ " ( k VARCHAR, c1.a bigint,c2.b bigint CONSTRAINT pk 
PRIMARY KEY (k)) "
++ (splitKey != null ? "split on (" + splitKey + ")" : 
""));
+conn.createStatement().execute("upsert into " + fullTableName + " 
values ('abc',1,3)");
+conn.createStatement().execute("upsert into " + fullTableName + " 
values ('def',2,4)");
 conn.commit();
-// CAll the update statistics query here

phoenix git commit: PHOENIX-2647 Duplicate results in reverse scan when guideposts are traversed (Ankit Singhal)

2016-02-05 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/master a82a0ff60 -> b64edb754


PHOENIX-2647 Duplicate results in reverse scan when guideposts are traversed 
(Ankit Singhal)


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

Branch: refs/heads/master
Commit: b64edb75455d56fc2a5086043bdd6fa1064f2ca7
Parents: a82a0ff
Author: Ankit Singhal 
Authored: Fri Feb 5 23:45:04 2016 +0530
Committer: Ankit Singhal 
Committed: Fri Feb 5 23:45:04 2016 +0530

--
 .../apache/phoenix/end2end/ReverseScanIT.java   | 21 +
 .../phoenix/end2end/StatsCollectorIT.java   | 28 +++
 .../java/org/apache/phoenix/util/ScanUtil.java  | 49 ++--
 3 files changed, 64 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b64edb75/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
index 35a8025..2722be1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
@@ -168,6 +168,27 @@ public class ReverseScanIT extends BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testReverseScanForSpecificRangeInRegion() throws Exception {
+Connection conn;
+ResultSet rs;
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+conn = DriverManager.getConnection(getUrl(), props);
+conn.createStatement()
+.execute("CREATE TABLE T" + " ( k VARCHAR, c1.a bigint,c2.b 
bigint CONSTRAINT pk PRIMARY KEY (k)) ");
+conn.createStatement().execute("upsert into T values ('a',1,3)");
+conn.createStatement().execute("upsert into T values ('b',1,3)");
+conn.createStatement().execute("upsert into T values ('c',1,3)");
+conn.createStatement().execute("upsert into T values ('d',1,3)");
+conn.createStatement().execute("upsert into T values ('e',1,3)");
+conn.commit();
+rs = conn.createStatement().executeQuery("SELECT k FROM T where k>'b' 
and k<'d' order by k desc");
+assertTrue(rs.next());
+assertEquals("c", rs.getString(1));
+assertTrue(!rs.next());
+conn.close();
+}
+
+@Test
 public void testReverseScanIndex() throws Exception {
 String tenantId = getOrganizationId();
 initATableValues(tenantId, getSplitsAtRowKeys(tenantId), getUrl());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b64edb75/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
index caba259..4450152 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
@@ -123,31 +123,41 @@ public class StatsCollectorIT extends 
StatsCollectorAbstractIT {
 conn.close();
 }
 
-@Test
-public void testNoDuplicatesAfterUpdateStats() throws Throwable {
+private void testNoDuplicatesAfterUpdateStats(String splitKey) throws 
Throwable {
 Connection conn;
 PreparedStatement stmt;
 ResultSet rs;
 Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement()
-.execute("CREATE TABLE " + fullTableName +" ( k VARCHAR, c1.a 
bigint,c2.b bigint CONSTRAINT pk PRIMARY KEY (k))" + tableDDLOptions );
-conn.createStatement().execute("upsert into " + fullTableName +" 
values ('abc',1,3)");
-conn.createStatement().execute("upsert into " + fullTableName +" 
values ('def',2,4)");
+.execute("CREATE TABLE " + fullTableName
++ " ( k VARCHAR, c1.a bigint,c2.b bigint CONSTRAINT pk 
PRIMARY KEY (k)) "
++ (splitKey != null ? "split on (" + splitKey + ")" : 
""));
+conn.createStatement().execute("upsert into " + fullTableName + " 
values ('abc',1,3)");
+conn.createStatement().execute("upsert into " + fullTableName + " 
values ('def',2,4)");
 conn.commit();
-// CAll the update statistics query here
 stmt = 

phoenix git commit: PHOENIX-2647 Duplicate results in reverse scan when guideposts are traversed (Ankit Singhal)

2016-02-05 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 a2fe62e24 -> 5cd5fe45c


PHOENIX-2647 Duplicate results in reverse scan when guideposts are traversed 
(Ankit Singhal)


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 5cd5fe45c425fc84d1ff2568e101ff026e3c24c4
Parents: a2fe62e
Author: Ankit Singhal 
Authored: Fri Feb 5 23:42:22 2016 +0530
Committer: Ankit Singhal 
Committed: Fri Feb 5 23:42:22 2016 +0530

--
 .../apache/phoenix/end2end/ReverseScanIT.java   | 21 +
 .../phoenix/end2end/StatsCollectorIT.java   | 28 +++
 .../java/org/apache/phoenix/util/ScanUtil.java  | 49 ++--
 3 files changed, 64 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5cd5fe45/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
index 35a8025..2722be1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseScanIT.java
@@ -168,6 +168,27 @@ public class ReverseScanIT extends BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testReverseScanForSpecificRangeInRegion() throws Exception {
+Connection conn;
+ResultSet rs;
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+conn = DriverManager.getConnection(getUrl(), props);
+conn.createStatement()
+.execute("CREATE TABLE T" + " ( k VARCHAR, c1.a bigint,c2.b 
bigint CONSTRAINT pk PRIMARY KEY (k)) ");
+conn.createStatement().execute("upsert into T values ('a',1,3)");
+conn.createStatement().execute("upsert into T values ('b',1,3)");
+conn.createStatement().execute("upsert into T values ('c',1,3)");
+conn.createStatement().execute("upsert into T values ('d',1,3)");
+conn.createStatement().execute("upsert into T values ('e',1,3)");
+conn.commit();
+rs = conn.createStatement().executeQuery("SELECT k FROM T where k>'b' 
and k<'d' order by k desc");
+assertTrue(rs.next());
+assertEquals("c", rs.getString(1));
+assertTrue(!rs.next());
+conn.close();
+}
+
+@Test
 public void testReverseScanIndex() throws Exception {
 String tenantId = getOrganizationId();
 initATableValues(tenantId, getSplitsAtRowKeys(tenantId), getUrl());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5cd5fe45/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
index 35889cd..b1d21c7 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
@@ -124,31 +124,41 @@ public class StatsCollectorIT extends 
StatsCollectorAbstractIT {
 conn.close();
 }
 
-@Test
-public void testNoDuplicatesAfterUpdateStats() throws Throwable {
+private void testNoDuplicatesAfterUpdateStats(String splitKey) throws 
Throwable {
 Connection conn;
 PreparedStatement stmt;
 ResultSet rs;
 Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement()
-.execute("CREATE TABLE " + fullTableName +" ( k VARCHAR, c1.a 
bigint,c2.b bigint CONSTRAINT pk PRIMARY KEY (k))" + tableDDLOptions );
-conn.createStatement().execute("upsert into " + fullTableName +" 
values ('abc',1,3)");
-conn.createStatement().execute("upsert into " + fullTableName +" 
values ('def',2,4)");
+.execute("CREATE TABLE " + fullTableName
++ " ( k VARCHAR, c1.a bigint,c2.b bigint CONSTRAINT pk 
PRIMARY KEY (k)) "
++ (splitKey != null ? "split on (" + splitKey + ")" : 
""));
+conn.createStatement().execute("upsert into " + fullTableName + " 
values ('abc',1,3)");
+conn.createStatement().execute("upsert into " + fullTableName + " 
values ('def',2,4)");
 conn.commit();
-// CAll the update statistics query here