phoenix git commit: PHOENIX-2894 Sort-merge join works incorrectly with DESC columns

2016-05-20 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 5f5b6fbe4 -> 7cbb2b9ea


PHOENIX-2894 Sort-merge join works incorrectly with DESC columns


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 7cbb2b9ea956e5c7f9263fdf54142d74c7282ad8
Parents: 5f5b6fb
Author: maryannxue 
Authored: Fri May 20 13:34:12 2016 -0400
Committer: maryannxue 
Committed: Fri May 20 13:34:12 2016 -0400

--
 .../apache/phoenix/end2end/HashJoinMoreIT.java  | 185 +
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 199 +++
 .../apache/phoenix/compile/JoinCompiler.java|   9 +-
 3 files changed, 389 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7cbb2b9e/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
index 98264f0..128baf3 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
@@ -690,4 +690,189 @@ public class HashJoinMoreIT extends 
BaseHBaseManagedTimeIT {
 conn.close();
 }
 }
+
+@Test
+public void testBug2894() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+conn.setAutoCommit(true);
+try {
+conn.createStatement().execute(
+"CREATE TABLE IF NOT EXISTS EVENT_COUNT (\n" +
+"BUCKET VARCHAR,\n" +
+"TIMESTAMP_DATE TIMESTAMP,\n" +
+"TIMESTAMP UNSIGNED_LONG NOT NULL,\n" +
+"LOCATION VARCHAR,\n" +
+"A VARCHAR,\n" +
+"B VARCHAR,\n" +
+"C VARCHAR,\n" +
+"D UNSIGNED_LONG,\n" +
+"E FLOAT\n" +
+"CONSTRAINT pk PRIMARY KEY (BUCKET, TIMESTAMP DESC, 
LOCATION, A, B, C)\n" +
+") SALT_BUCKETS=2, COMPRESSION='GZ', TTL=31622400");
+PreparedStatement stmt = conn.prepareStatement("UPSERT INTO 
EVENT_COUNT(BUCKET, TIMESTAMP, LOCATION, A, B, C) VALUES(?,?,?,?,?,?)");
+stmt.setString(1, "5SEC");
+stmt.setString(3, "Tr/Bal");
+stmt.setString(4, "A1");
+stmt.setString(5, "B1");
+stmt.setString(6, "C1");
+stmt.setLong(2, 14629935200L);
+stmt.execute();
+stmt.setLong(2, 14629935150L);
+stmt.execute();
+stmt.setLong(2, 14629935100L);
+stmt.execute();
+stmt.setLong(2, 14629935050L);
+stmt.execute();
+stmt.setLong(2, 14629935000L);
+stmt.execute();
+stmt.setLong(2, 14629934950L);
+stmt.execute();
+stmt.setLong(2, 14629934900L);
+stmt.execute();
+stmt.setLong(2, 14629934850L);
+stmt.execute();
+stmt.setLong(2, 14629934800L);
+stmt.execute();
+stmt.setLong(2, 14629934750L);
+stmt.execute();
+stmt.setLong(2, 14629934700L);
+stmt.execute();
+stmt.setLong(2, 14629934650L);
+stmt.execute();
+stmt.setLong(2, 14629934600L);
+stmt.execute();
+stmt.setLong(2, 14629934550L);
+stmt.execute();
+stmt.setLong(2, 14629934500L);
+stmt.execute();
+stmt.setLong(2, 14629934450L);
+stmt.execute();
+stmt.setLong(2, 14629934400L);
+stmt.execute();
+stmt.setLong(2, 14629934300L);
+stmt.execute();
+
+// We'll test the original version of the user table as well as a 
slightly modified
+// version, in order to verify that hash join works for columns 
both having DESC
+// sort order as well as one having ASC order and the other having 
DESC order.
+String[] t = new String[] {"EVENT_LATENCY", "EVENT_LATENCY_2"};
+for (int i = 0; i < 2; i++) 

phoenix git commit: PHOENIX-2894 Sort-merge join works incorrectly with DESC columns

2016-05-20 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 64be3a3d4 -> a05137b2f


PHOENIX-2894 Sort-merge join works incorrectly with DESC columns


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

Branch: refs/heads/4.x-HBase-1.0
Commit: a05137b2f591874909ef9bbefecdcbb086e7ba86
Parents: 64be3a3
Author: maryannxue 
Authored: Fri May 20 13:29:49 2016 -0400
Committer: maryannxue 
Committed: Fri May 20 13:29:49 2016 -0400

--
 .../apache/phoenix/end2end/HashJoinMoreIT.java  | 185 +
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 199 +++
 .../apache/phoenix/compile/JoinCompiler.java|   9 +-
 3 files changed, 389 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a05137b2/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
index 98264f0..128baf3 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
@@ -690,4 +690,189 @@ public class HashJoinMoreIT extends 
BaseHBaseManagedTimeIT {
 conn.close();
 }
 }
+
+@Test
+public void testBug2894() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+conn.setAutoCommit(true);
+try {
+conn.createStatement().execute(
+"CREATE TABLE IF NOT EXISTS EVENT_COUNT (\n" +
+"BUCKET VARCHAR,\n" +
+"TIMESTAMP_DATE TIMESTAMP,\n" +
+"TIMESTAMP UNSIGNED_LONG NOT NULL,\n" +
+"LOCATION VARCHAR,\n" +
+"A VARCHAR,\n" +
+"B VARCHAR,\n" +
+"C VARCHAR,\n" +
+"D UNSIGNED_LONG,\n" +
+"E FLOAT\n" +
+"CONSTRAINT pk PRIMARY KEY (BUCKET, TIMESTAMP DESC, 
LOCATION, A, B, C)\n" +
+") SALT_BUCKETS=2, COMPRESSION='GZ', TTL=31622400");
+PreparedStatement stmt = conn.prepareStatement("UPSERT INTO 
EVENT_COUNT(BUCKET, TIMESTAMP, LOCATION, A, B, C) VALUES(?,?,?,?,?,?)");
+stmt.setString(1, "5SEC");
+stmt.setString(3, "Tr/Bal");
+stmt.setString(4, "A1");
+stmt.setString(5, "B1");
+stmt.setString(6, "C1");
+stmt.setLong(2, 14629935200L);
+stmt.execute();
+stmt.setLong(2, 14629935150L);
+stmt.execute();
+stmt.setLong(2, 14629935100L);
+stmt.execute();
+stmt.setLong(2, 14629935050L);
+stmt.execute();
+stmt.setLong(2, 14629935000L);
+stmt.execute();
+stmt.setLong(2, 14629934950L);
+stmt.execute();
+stmt.setLong(2, 14629934900L);
+stmt.execute();
+stmt.setLong(2, 14629934850L);
+stmt.execute();
+stmt.setLong(2, 14629934800L);
+stmt.execute();
+stmt.setLong(2, 14629934750L);
+stmt.execute();
+stmt.setLong(2, 14629934700L);
+stmt.execute();
+stmt.setLong(2, 14629934650L);
+stmt.execute();
+stmt.setLong(2, 14629934600L);
+stmt.execute();
+stmt.setLong(2, 14629934550L);
+stmt.execute();
+stmt.setLong(2, 14629934500L);
+stmt.execute();
+stmt.setLong(2, 14629934450L);
+stmt.execute();
+stmt.setLong(2, 14629934400L);
+stmt.execute();
+stmt.setLong(2, 14629934300L);
+stmt.execute();
+
+// We'll test the original version of the user table as well as a 
slightly modified
+// version, in order to verify that hash join works for columns 
both having DESC
+// sort order as well as one having ASC order and the other having 
DESC order.
+String[] t = new String[] {"EVENT_LATENCY", "EVENT_LATENCY_2"};
+for (int i = 0; i < 2; i++) {

phoenix git commit: PHOENIX-2894 Sort-merge join works incorrectly with DESC columns

2016-05-20 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 cdab93a2d -> 626c26ac7


PHOENIX-2894 Sort-merge join works incorrectly with DESC columns


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 626c26ac78c100075c430c6a396daaa9e2ab388b
Parents: cdab93a
Author: maryannxue 
Authored: Fri May 20 13:24:35 2016 -0400
Committer: maryannxue 
Committed: Fri May 20 13:24:35 2016 -0400

--
 .../apache/phoenix/end2end/HashJoinMoreIT.java  | 185 +
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 199 +++
 .../apache/phoenix/compile/JoinCompiler.java|   9 +-
 3 files changed, 389 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/626c26ac/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
index 98264f0..128baf3 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
@@ -690,4 +690,189 @@ public class HashJoinMoreIT extends 
BaseHBaseManagedTimeIT {
 conn.close();
 }
 }
+
+@Test
+public void testBug2894() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+conn.setAutoCommit(true);
+try {
+conn.createStatement().execute(
+"CREATE TABLE IF NOT EXISTS EVENT_COUNT (\n" +
+"BUCKET VARCHAR,\n" +
+"TIMESTAMP_DATE TIMESTAMP,\n" +
+"TIMESTAMP UNSIGNED_LONG NOT NULL,\n" +
+"LOCATION VARCHAR,\n" +
+"A VARCHAR,\n" +
+"B VARCHAR,\n" +
+"C VARCHAR,\n" +
+"D UNSIGNED_LONG,\n" +
+"E FLOAT\n" +
+"CONSTRAINT pk PRIMARY KEY (BUCKET, TIMESTAMP DESC, 
LOCATION, A, B, C)\n" +
+") SALT_BUCKETS=2, COMPRESSION='GZ', TTL=31622400");
+PreparedStatement stmt = conn.prepareStatement("UPSERT INTO 
EVENT_COUNT(BUCKET, TIMESTAMP, LOCATION, A, B, C) VALUES(?,?,?,?,?,?)");
+stmt.setString(1, "5SEC");
+stmt.setString(3, "Tr/Bal");
+stmt.setString(4, "A1");
+stmt.setString(5, "B1");
+stmt.setString(6, "C1");
+stmt.setLong(2, 14629935200L);
+stmt.execute();
+stmt.setLong(2, 14629935150L);
+stmt.execute();
+stmt.setLong(2, 14629935100L);
+stmt.execute();
+stmt.setLong(2, 14629935050L);
+stmt.execute();
+stmt.setLong(2, 14629935000L);
+stmt.execute();
+stmt.setLong(2, 14629934950L);
+stmt.execute();
+stmt.setLong(2, 14629934900L);
+stmt.execute();
+stmt.setLong(2, 14629934850L);
+stmt.execute();
+stmt.setLong(2, 14629934800L);
+stmt.execute();
+stmt.setLong(2, 14629934750L);
+stmt.execute();
+stmt.setLong(2, 14629934700L);
+stmt.execute();
+stmt.setLong(2, 14629934650L);
+stmt.execute();
+stmt.setLong(2, 14629934600L);
+stmt.execute();
+stmt.setLong(2, 14629934550L);
+stmt.execute();
+stmt.setLong(2, 14629934500L);
+stmt.execute();
+stmt.setLong(2, 14629934450L);
+stmt.execute();
+stmt.setLong(2, 14629934400L);
+stmt.execute();
+stmt.setLong(2, 14629934300L);
+stmt.execute();
+
+// We'll test the original version of the user table as well as a 
slightly modified
+// version, in order to verify that hash join works for columns 
both having DESC
+// sort order as well as one having ASC order and the other having 
DESC order.
+String[] t = new String[] {"EVENT_LATENCY", "EVENT_LATENCY_2"};
+for (int i = 0; i < 2; i++) {

[1/2] phoenix git commit: PHOENIX-2894 Sort-merge join works incorrectly with DESC columns

2016-05-20 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/master 8445d0206 -> 01405d5d6


PHOENIX-2894 Sort-merge join works incorrectly with DESC columns


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

Branch: refs/heads/master
Commit: 2f329e0ad62aaeb80b3d8eae6fc48c96010d5cf6
Parents: 4ee0989
Author: maryannxue 
Authored: Fri May 20 12:24:16 2016 -0400
Committer: maryannxue 
Committed: Fri May 20 12:24:16 2016 -0400

--
 .../apache/phoenix/end2end/HashJoinMoreIT.java  | 185 +
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 199 +++
 .../apache/phoenix/compile/JoinCompiler.java|   9 +-
 3 files changed, 389 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2f329e0a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
index 98264f0..128baf3 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinMoreIT.java
@@ -690,4 +690,189 @@ public class HashJoinMoreIT extends 
BaseHBaseManagedTimeIT {
 conn.close();
 }
 }
+
+@Test
+public void testBug2894() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+conn.setAutoCommit(true);
+try {
+conn.createStatement().execute(
+"CREATE TABLE IF NOT EXISTS EVENT_COUNT (\n" +
+"BUCKET VARCHAR,\n" +
+"TIMESTAMP_DATE TIMESTAMP,\n" +
+"TIMESTAMP UNSIGNED_LONG NOT NULL,\n" +
+"LOCATION VARCHAR,\n" +
+"A VARCHAR,\n" +
+"B VARCHAR,\n" +
+"C VARCHAR,\n" +
+"D UNSIGNED_LONG,\n" +
+"E FLOAT\n" +
+"CONSTRAINT pk PRIMARY KEY (BUCKET, TIMESTAMP DESC, 
LOCATION, A, B, C)\n" +
+") SALT_BUCKETS=2, COMPRESSION='GZ', TTL=31622400");
+PreparedStatement stmt = conn.prepareStatement("UPSERT INTO 
EVENT_COUNT(BUCKET, TIMESTAMP, LOCATION, A, B, C) VALUES(?,?,?,?,?,?)");
+stmt.setString(1, "5SEC");
+stmt.setString(3, "Tr/Bal");
+stmt.setString(4, "A1");
+stmt.setString(5, "B1");
+stmt.setString(6, "C1");
+stmt.setLong(2, 14629935200L);
+stmt.execute();
+stmt.setLong(2, 14629935150L);
+stmt.execute();
+stmt.setLong(2, 14629935100L);
+stmt.execute();
+stmt.setLong(2, 14629935050L);
+stmt.execute();
+stmt.setLong(2, 14629935000L);
+stmt.execute();
+stmt.setLong(2, 14629934950L);
+stmt.execute();
+stmt.setLong(2, 14629934900L);
+stmt.execute();
+stmt.setLong(2, 14629934850L);
+stmt.execute();
+stmt.setLong(2, 14629934800L);
+stmt.execute();
+stmt.setLong(2, 14629934750L);
+stmt.execute();
+stmt.setLong(2, 14629934700L);
+stmt.execute();
+stmt.setLong(2, 14629934650L);
+stmt.execute();
+stmt.setLong(2, 14629934600L);
+stmt.execute();
+stmt.setLong(2, 14629934550L);
+stmt.execute();
+stmt.setLong(2, 14629934500L);
+stmt.execute();
+stmt.setLong(2, 14629934450L);
+stmt.execute();
+stmt.setLong(2, 14629934400L);
+stmt.execute();
+stmt.setLong(2, 14629934300L);
+stmt.execute();
+
+// We'll test the original version of the user table as well as a 
slightly modified
+// version, in order to verify that hash join works for columns 
both having DESC
+// sort order as well as one having ASC order and the other having 
DESC order.
+String[] t = new String[] {"EVENT_LATENCY", "EVENT_LATENCY_2"};
+for (int i = 0; i < 2; i++) {
+