phoenix git commit: PHOENIX-2169 Illegal data error on UPSERT SELECT and JOIN with salted tables(Ankit Singhal)

2016-02-04 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 35944997a -> 0e8f4b23c


PHOENIX-2169 Illegal data error on UPSERT SELECT and JOIN with salted 
tables(Ankit Singhal)


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 0e8f4b23cfe44488e14f77b37b9426dd5707f6c9
Parents: 3594499
Author: Ankit Singhal 
Authored: Thu Feb 4 15:29:44 2016 +0530
Committer: Ankit Singhal 
Committed: Thu Feb 4 15:29:44 2016 +0530

--
 .../salted/SaltedTableUpsertSelectIT.java   | 57 
 .../expression/ProjectedColumnExpression.java   | 11 +++-
 .../visitor/CloneExpressionVisitor.java |  2 +-
 3 files changed, 68 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0e8f4b23/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
index 0a11ec7..65eeb20 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
@@ -225,4 +225,61 @@ public class SaltedTableUpsertSelectIT extends 
BaseHBaseManagedTimeIT {
 conn.close();
 }
 }
+
+@Test
+public void testUpsertSelectWithJoinOnSaltedTables() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+conn.setAutoCommit(false);
+try {
+String ddl = "CREATE TABLE IF NOT EXISTS source1" +
+" (pk1 varchar NULL, pk2 varchar NULL, pk3 integer NOT 
NULL, col1 INTEGER" +
+" CONSTRAINT pk PRIMARY KEY (pk1, pk2, pk3)) 
SALT_BUCKETS=4";
+createTestTable(getUrl(), ddl);
+
+for (int i = 0; i < 1000; i++) {
+String upsert = "UPSERT INTO source1(pk1, pk2, pk3, col1) 
VALUES (?,?,?,?)";
+PreparedStatement stmt = conn.prepareStatement(upsert);
+stmt.setString(1, Integer.toString(i));
+stmt.setString(2, Integer.toString(i));
+stmt.setInt(3, i);
+stmt.setInt(4, i);
+stmt.execute();
+}
+conn.commit();
+
+String ddl2 = "CREATE TABLE IF NOT EXISTS source2" +
+" (pk1 varchar NULL, pk2 varchar NULL, pk3 integer NOT 
NULL, col1 INTEGER" +
+" CONSTRAINT pk PRIMARY KEY (pk1, pk2, pk3)) 
SALT_BUCKETS=4";
+createTestTable(getUrl(), ddl2);
+
+for (int i = 0; i < 1000; i++) {
+String upsert = "UPSERT INTO source2(pk1, pk2, pk3, col1) 
VALUES (?,?,?,?)";
+PreparedStatement stmt = conn.prepareStatement(upsert);
+stmt.setString(1, Integer.toString(i));
+stmt.setString(2, Integer.toString(i));
+stmt.setInt(3, i);
+stmt.setInt(4, i);
+stmt.execute();
+}
+conn.commit();
+
+String ddl3 = "CREATE TABLE IF NOT EXISTS dest" +
+" (pk1 varchar NULL, pk2 varchar NULL, pk3 integer NOT 
NULL, col1 INTEGER" +
+" CONSTRAINT pk PRIMARY KEY (pk1, pk2, pk3)) 
SALT_BUCKETS=4";
+createTestTable(getUrl(), ddl3);
+
+String query = "UPSERT INTO dest(pk1, pk2, pk3, col1) SELECT 
S1.pk1, S1.pk2, S2.pk3, S2.col1 FROM source1 AS S1 JOIN source2 AS S2 ON S1.pk1 
= S2.pk1 AND S1.pk2 = S2.pk2 AND S1.pk3 = S2.pk3";
+conn.createStatement().execute(query);
+conn.commit();
+
+query = "SELECT COUNT(*) FROM dest";
+PreparedStatement stmt = conn.prepareStatement(query);
+ResultSet rs = stmt.executeQuery();
+assertTrue(rs.next());
+assertEquals(1000, rs.getInt(1));
+} finally {
+conn.close();
+}
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0e8f4b23/phoenix-core/src/main/java/org/apache/phoenix/expression/ProjectedColumnExpression.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/ProjectedColumnExpression.java
 

phoenix git commit: PHOENIX-2169 Illegal data error on UPSERT SELECT and JOIN with salted tables(Ankit Singhal)

2016-02-04 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/master 12f6a6f48 -> 79724226c


PHOENIX-2169 Illegal data error on UPSERT SELECT and JOIN with salted 
tables(Ankit Singhal)


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

Branch: refs/heads/master
Commit: 79724226c737c905b748d73fe8f4d70dca743578
Parents: 12f6a6f
Author: Ankit Singhal 
Authored: Thu Feb 4 15:27:04 2016 +0530
Committer: Ankit Singhal 
Committed: Thu Feb 4 15:27:04 2016 +0530

--
 .../salted/SaltedTableUpsertSelectIT.java   | 57 
 .../expression/ProjectedColumnExpression.java   | 11 +++-
 .../visitor/CloneExpressionVisitor.java |  2 +-
 3 files changed, 68 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/79724226/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
index 0a11ec7..65eeb20 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
@@ -225,4 +225,61 @@ public class SaltedTableUpsertSelectIT extends 
BaseHBaseManagedTimeIT {
 conn.close();
 }
 }
+
+@Test
+public void testUpsertSelectWithJoinOnSaltedTables() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+conn.setAutoCommit(false);
+try {
+String ddl = "CREATE TABLE IF NOT EXISTS source1" +
+" (pk1 varchar NULL, pk2 varchar NULL, pk3 integer NOT 
NULL, col1 INTEGER" +
+" CONSTRAINT pk PRIMARY KEY (pk1, pk2, pk3)) 
SALT_BUCKETS=4";
+createTestTable(getUrl(), ddl);
+
+for (int i = 0; i < 1000; i++) {
+String upsert = "UPSERT INTO source1(pk1, pk2, pk3, col1) 
VALUES (?,?,?,?)";
+PreparedStatement stmt = conn.prepareStatement(upsert);
+stmt.setString(1, Integer.toString(i));
+stmt.setString(2, Integer.toString(i));
+stmt.setInt(3, i);
+stmt.setInt(4, i);
+stmt.execute();
+}
+conn.commit();
+
+String ddl2 = "CREATE TABLE IF NOT EXISTS source2" +
+" (pk1 varchar NULL, pk2 varchar NULL, pk3 integer NOT 
NULL, col1 INTEGER" +
+" CONSTRAINT pk PRIMARY KEY (pk1, pk2, pk3)) 
SALT_BUCKETS=4";
+createTestTable(getUrl(), ddl2);
+
+for (int i = 0; i < 1000; i++) {
+String upsert = "UPSERT INTO source2(pk1, pk2, pk3, col1) 
VALUES (?,?,?,?)";
+PreparedStatement stmt = conn.prepareStatement(upsert);
+stmt.setString(1, Integer.toString(i));
+stmt.setString(2, Integer.toString(i));
+stmt.setInt(3, i);
+stmt.setInt(4, i);
+stmt.execute();
+}
+conn.commit();
+
+String ddl3 = "CREATE TABLE IF NOT EXISTS dest" +
+" (pk1 varchar NULL, pk2 varchar NULL, pk3 integer NOT 
NULL, col1 INTEGER" +
+" CONSTRAINT pk PRIMARY KEY (pk1, pk2, pk3)) 
SALT_BUCKETS=4";
+createTestTable(getUrl(), ddl3);
+
+String query = "UPSERT INTO dest(pk1, pk2, pk3, col1) SELECT 
S1.pk1, S1.pk2, S2.pk3, S2.col1 FROM source1 AS S1 JOIN source2 AS S2 ON S1.pk1 
= S2.pk1 AND S1.pk2 = S2.pk2 AND S1.pk3 = S2.pk3";
+conn.createStatement().execute(query);
+conn.commit();
+
+query = "SELECT COUNT(*) FROM dest";
+PreparedStatement stmt = conn.prepareStatement(query);
+ResultSet rs = stmt.executeQuery();
+assertTrue(rs.next());
+assertEquals(1000, rs.getInt(1));
+} finally {
+conn.close();
+}
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/79724226/phoenix-core/src/main/java/org/apache/phoenix/expression/ProjectedColumnExpression.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/ProjectedColumnExpression.java
 

phoenix git commit: PHOENIX-2169 Illegal data error on UPSERT SELECT and JOIN with salted tables(Ankit Singhal)

2016-02-04 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 d0174744c -> 20a995e55


PHOENIX-2169 Illegal data error on UPSERT SELECT and JOIN with salted 
tables(Ankit Singhal)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 20a995e554cafc99ab1a35fa8b8f957dc1f2c54f
Parents: d017474
Author: Ankit Singhal 
Authored: Thu Feb 4 15:30:23 2016 +0530
Committer: Ankit Singhal 
Committed: Thu Feb 4 15:30:23 2016 +0530

--
 .../salted/SaltedTableUpsertSelectIT.java   | 57 
 .../expression/ProjectedColumnExpression.java   | 11 +++-
 .../visitor/CloneExpressionVisitor.java |  2 +-
 3 files changed, 68 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/20a995e5/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
index 0a11ec7..65eeb20 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableUpsertSelectIT.java
@@ -225,4 +225,61 @@ public class SaltedTableUpsertSelectIT extends 
BaseHBaseManagedTimeIT {
 conn.close();
 }
 }
+
+@Test
+public void testUpsertSelectWithJoinOnSaltedTables() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+conn.setAutoCommit(false);
+try {
+String ddl = "CREATE TABLE IF NOT EXISTS source1" +
+" (pk1 varchar NULL, pk2 varchar NULL, pk3 integer NOT 
NULL, col1 INTEGER" +
+" CONSTRAINT pk PRIMARY KEY (pk1, pk2, pk3)) 
SALT_BUCKETS=4";
+createTestTable(getUrl(), ddl);
+
+for (int i = 0; i < 1000; i++) {
+String upsert = "UPSERT INTO source1(pk1, pk2, pk3, col1) 
VALUES (?,?,?,?)";
+PreparedStatement stmt = conn.prepareStatement(upsert);
+stmt.setString(1, Integer.toString(i));
+stmt.setString(2, Integer.toString(i));
+stmt.setInt(3, i);
+stmt.setInt(4, i);
+stmt.execute();
+}
+conn.commit();
+
+String ddl2 = "CREATE TABLE IF NOT EXISTS source2" +
+" (pk1 varchar NULL, pk2 varchar NULL, pk3 integer NOT 
NULL, col1 INTEGER" +
+" CONSTRAINT pk PRIMARY KEY (pk1, pk2, pk3)) 
SALT_BUCKETS=4";
+createTestTable(getUrl(), ddl2);
+
+for (int i = 0; i < 1000; i++) {
+String upsert = "UPSERT INTO source2(pk1, pk2, pk3, col1) 
VALUES (?,?,?,?)";
+PreparedStatement stmt = conn.prepareStatement(upsert);
+stmt.setString(1, Integer.toString(i));
+stmt.setString(2, Integer.toString(i));
+stmt.setInt(3, i);
+stmt.setInt(4, i);
+stmt.execute();
+}
+conn.commit();
+
+String ddl3 = "CREATE TABLE IF NOT EXISTS dest" +
+" (pk1 varchar NULL, pk2 varchar NULL, pk3 integer NOT 
NULL, col1 INTEGER" +
+" CONSTRAINT pk PRIMARY KEY (pk1, pk2, pk3)) 
SALT_BUCKETS=4";
+createTestTable(getUrl(), ddl3);
+
+String query = "UPSERT INTO dest(pk1, pk2, pk3, col1) SELECT 
S1.pk1, S1.pk2, S2.pk3, S2.col1 FROM source1 AS S1 JOIN source2 AS S2 ON S1.pk1 
= S2.pk1 AND S1.pk2 = S2.pk2 AND S1.pk3 = S2.pk3";
+conn.createStatement().execute(query);
+conn.commit();
+
+query = "SELECT COUNT(*) FROM dest";
+PreparedStatement stmt = conn.prepareStatement(query);
+ResultSet rs = stmt.executeQuery();
+assertTrue(rs.next());
+assertEquals(1000, rs.getInt(1));
+} finally {
+conn.close();
+}
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/20a995e5/phoenix-core/src/main/java/org/apache/phoenix/expression/ProjectedColumnExpression.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/ProjectedColumnExpression.java
 

Apache-Phoenix | 4.x-HBase-1.0 | Build Successful

2016-02-04 Thread Apache Jenkins Server
4.x-HBase-1.0 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.x-HBase-1.0

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.x-HBase-1.0/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.x-HBase-1.0/lastCompletedBuild/testReport/

Changes
[ankitsinghal59] PHOENIX-2169 Illegal data error on UPSERT SELECT and JOIN with salted



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


Apache-Phoenix | 4.x-HBase-0.98 | Build Successful

2016-02-04 Thread Apache Jenkins Server
4.x-HBase-0.98 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.x-HBase-0.98

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.x-HBase-0.98/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.x-HBase-0.98/lastCompletedBuild/testReport/

Changes
[ankitsinghal59] PHOENIX-2169 Illegal data error on UPSERT SELECT and JOIN with salted



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


[3/3] phoenix git commit: PHOENIX-2649 - GC/OOM during BulkLoad (Sergey Soldatov)

2016-02-04 Thread ravimagham
PHOENIX-2649 - GC/OOM during BulkLoad (Sergey Soldatov)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 650ae264da8485d8066cc61af83c9dd24005f38a
Parents: 20a995e
Author: ravimagham 
Authored: Thu Feb 4 14:41:52 2016 -0800
Committer: ravimagham 
Committed: Thu Feb 4 14:41:52 2016 -0800

--
 .../mapreduce/bulkload/TableRowkeyPair.java | 38 +---
 .../mapreduce/bulkload/TestTableRowkeyPair.java |  6 ++--
 2 files changed, 37 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/650ae264/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
index e3032be..ac80341 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
@@ -22,7 +22,7 @@ import java.io.DataOutput;
 import java.io.IOException;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.io.BytesWritable;
+import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.io.WritableComparator;
 import org.apache.hadoop.io.WritableUtils;
@@ -30,6 +30,7 @@ import org.apache.hadoop.io.WritableUtils;
 import com.google.common.base.Preconditions;
 
 
+
 /**
  * A WritableComparable to hold the table name and the rowkey.
  */
@@ -101,9 +102,38 @@ public class TableRowkeyPair implements 
WritableComparable {
 return this.tableName.compareTo(otherTableName);
 }
 }
-
-static { 
-WritableComparator.define(TableRowkeyPair.class, new 
BytesWritable.Comparator());
+
+/** Comparator for TableRowkeyPair. */
+public static class Comparator extends WritableComparator {
+
+public Comparator() {
+super(TableRowkeyPair.class);
+}
+
+@Override
+public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int 
l2) {
+try {
+// Compare table names
+int strL1 = readInt(b1, s1);
+int strL2 = readInt(b2, s2);
+int cmp = compareBytes(b1, s1 + Bytes.SIZEOF_INT, strL1, b2, 
s2 + Bytes.SIZEOF_INT, strL2);
+if (cmp != 0) {
+return cmp;
+}
+// Compare row keys
+int strL3 = readInt(b1, s1 + Bytes.SIZEOF_INT + strL1);
+int strL4 = readInt(b2, s2 + Bytes.SIZEOF_INT + strL2);
+int i = compareBytes(b1, s1 + Bytes.SIZEOF_INT*2 + strL1, 
strL3, b2, s2
++ Bytes.SIZEOF_INT*2 + strL2, strL4);
+return i;
+} catch(Exception ex) {
+throw new IllegalArgumentException(ex);
+}
+}
+}
+
+static {
+WritableComparator.define(TableRowkeyPair.class, new Comparator());
 }
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/650ae264/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
index 1fee4bb..2a29c00 100644
--- 
a/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
@@ -23,7 +23,6 @@ import java.io.IOException;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.io.BytesWritable;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -38,8 +37,9 @@ public class TestTableRowkeyPair {
 testsRowsKeys("first", "aa", "first", "ab", -1);
 testsRowsKeys("second", "aa", "first", "aa", 1);
 testsRowsKeys("first", "aa", "first", "aaa", -1);
+testsRowsKeys("first","bb", "first", "", 1);
 }
-
+
 private void testsRowsKeys(String aTable, String akey, String bTable, 
String bkey, int expectedSignum) throws IOException {
 
 final 

[1/3] phoenix git commit: PHOENIX-2649 - GC/OOM during BulkLoad (Sergey Soldatov)

2016-02-04 Thread ravimagham
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 20a995e55 -> 650ae264d
  refs/heads/4.x-HBase-1.0 0e8f4b23c -> a2fe62e24
  refs/heads/master 79724226c -> a82a0ff60


PHOENIX-2649 - GC/OOM during BulkLoad (Sergey Soldatov)


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

Branch: refs/heads/master
Commit: a82a0ff608f90c470a1290296f8ed08243956fc9
Parents: 7972422
Author: ravimagham 
Authored: Thu Feb 4 14:38:43 2016 -0800
Committer: ravimagham 
Committed: Thu Feb 4 14:38:43 2016 -0800

--
 .../mapreduce/bulkload/TableRowkeyPair.java | 38 +---
 .../mapreduce/bulkload/TestTableRowkeyPair.java |  6 ++--
 2 files changed, 37 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a82a0ff6/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
index e3032be..ac80341 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
@@ -22,7 +22,7 @@ import java.io.DataOutput;
 import java.io.IOException;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.io.BytesWritable;
+import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.io.WritableComparator;
 import org.apache.hadoop.io.WritableUtils;
@@ -30,6 +30,7 @@ import org.apache.hadoop.io.WritableUtils;
 import com.google.common.base.Preconditions;
 
 
+
 /**
  * A WritableComparable to hold the table name and the rowkey.
  */
@@ -101,9 +102,38 @@ public class TableRowkeyPair implements 
WritableComparable {
 return this.tableName.compareTo(otherTableName);
 }
 }
-
-static { 
-WritableComparator.define(TableRowkeyPair.class, new 
BytesWritable.Comparator());
+
+/** Comparator for TableRowkeyPair. */
+public static class Comparator extends WritableComparator {
+
+public Comparator() {
+super(TableRowkeyPair.class);
+}
+
+@Override
+public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int 
l2) {
+try {
+// Compare table names
+int strL1 = readInt(b1, s1);
+int strL2 = readInt(b2, s2);
+int cmp = compareBytes(b1, s1 + Bytes.SIZEOF_INT, strL1, b2, 
s2 + Bytes.SIZEOF_INT, strL2);
+if (cmp != 0) {
+return cmp;
+}
+// Compare row keys
+int strL3 = readInt(b1, s1 + Bytes.SIZEOF_INT + strL1);
+int strL4 = readInt(b2, s2 + Bytes.SIZEOF_INT + strL2);
+int i = compareBytes(b1, s1 + Bytes.SIZEOF_INT*2 + strL1, 
strL3, b2, s2
++ Bytes.SIZEOF_INT*2 + strL2, strL4);
+return i;
+} catch(Exception ex) {
+throw new IllegalArgumentException(ex);
+}
+}
+}
+
+static {
+WritableComparator.define(TableRowkeyPair.class, new Comparator());
 }
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a82a0ff6/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
index 1fee4bb..2a29c00 100644
--- 
a/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
@@ -23,7 +23,6 @@ import java.io.IOException;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.io.BytesWritable;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -38,8 +37,9 @@ public class TestTableRowkeyPair {
 testsRowsKeys("first", "aa", "first", "ab", -1);
 testsRowsKeys("second", "aa", "first", "aa", 1);
 testsRowsKeys("first", "aa", "first", "aaa", -1);
+testsRowsKeys("first","bb", "first", "", 1);
 }
-   

[2/3] phoenix git commit: PHOENIX-2649 - GC/OOM during BulkLoad (Sergey Soldatov)

2016-02-04 Thread ravimagham
PHOENIX-2649 - GC/OOM during BulkLoad (Sergey Soldatov)


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

Branch: refs/heads/4.x-HBase-1.0
Commit: a2fe62e244a6ef4ed03dd9727815d96102f4d39c
Parents: 0e8f4b2
Author: ravimagham 
Authored: Thu Feb 4 14:40:36 2016 -0800
Committer: ravimagham 
Committed: Thu Feb 4 14:40:36 2016 -0800

--
 .../mapreduce/bulkload/TableRowkeyPair.java | 38 +---
 .../mapreduce/bulkload/TestTableRowkeyPair.java |  6 ++--
 2 files changed, 37 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a2fe62e2/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
index e3032be..ac80341 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/bulkload/TableRowkeyPair.java
@@ -22,7 +22,7 @@ import java.io.DataOutput;
 import java.io.IOException;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.io.BytesWritable;
+import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.io.WritableComparator;
 import org.apache.hadoop.io.WritableUtils;
@@ -30,6 +30,7 @@ import org.apache.hadoop.io.WritableUtils;
 import com.google.common.base.Preconditions;
 
 
+
 /**
  * A WritableComparable to hold the table name and the rowkey.
  */
@@ -101,9 +102,38 @@ public class TableRowkeyPair implements 
WritableComparable {
 return this.tableName.compareTo(otherTableName);
 }
 }
-
-static { 
-WritableComparator.define(TableRowkeyPair.class, new 
BytesWritable.Comparator());
+
+/** Comparator for TableRowkeyPair. */
+public static class Comparator extends WritableComparator {
+
+public Comparator() {
+super(TableRowkeyPair.class);
+}
+
+@Override
+public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int 
l2) {
+try {
+// Compare table names
+int strL1 = readInt(b1, s1);
+int strL2 = readInt(b2, s2);
+int cmp = compareBytes(b1, s1 + Bytes.SIZEOF_INT, strL1, b2, 
s2 + Bytes.SIZEOF_INT, strL2);
+if (cmp != 0) {
+return cmp;
+}
+// Compare row keys
+int strL3 = readInt(b1, s1 + Bytes.SIZEOF_INT + strL1);
+int strL4 = readInt(b2, s2 + Bytes.SIZEOF_INT + strL2);
+int i = compareBytes(b1, s1 + Bytes.SIZEOF_INT*2 + strL1, 
strL3, b2, s2
++ Bytes.SIZEOF_INT*2 + strL2, strL4);
+return i;
+} catch(Exception ex) {
+throw new IllegalArgumentException(ex);
+}
+}
+}
+
+static {
+WritableComparator.define(TableRowkeyPair.class, new Comparator());
 }
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a2fe62e2/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
index 1fee4bb..2a29c00 100644
--- 
a/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/mapreduce/bulkload/TestTableRowkeyPair.java
@@ -23,7 +23,6 @@ import java.io.IOException;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.io.BytesWritable;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -38,8 +37,9 @@ public class TestTableRowkeyPair {
 testsRowsKeys("first", "aa", "first", "ab", -1);
 testsRowsKeys("second", "aa", "first", "aa", 1);
 testsRowsKeys("first", "aa", "first", "aaa", -1);
+testsRowsKeys("first","bb", "first", "", 1);
 }
-
+
 private void testsRowsKeys(String aTable, String akey, String bTable, 
String bkey, int expectedSignum) throws IOException {
 
 final 

Apache-Phoenix | 4.x-HBase-0.98 | Build Successful

2016-02-04 Thread Apache Jenkins Server
4.x-HBase-0.98 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.x-HBase-0.98

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.x-HBase-0.98/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.x-HBase-0.98/lastCompletedBuild/testReport/

Changes
[ravimagham] PHOENIX-2649 - GC/OOM during BulkLoad (Sergey Soldatov)



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


svn commit: r1728583 - in /phoenix/site: publish/ publish/language/ source/src/site/

2016-02-04 Thread jamestaylor
Author: jamestaylor
Date: Fri Feb  5 01:29:14 2016
New Revision: 1728583

URL: http://svn.apache.org/viewvc?rev=1728583=rev
Log:
Remove EMR link in Using menu since they aren't including Phoenix

Modified:
phoenix/site/publish/Phoenix-in-15-minutes-or-less.html
phoenix/site/publish/array_type.html
phoenix/site/publish/building.html
phoenix/site/publish/building_website.html
phoenix/site/publish/bulk_dataload.html
phoenix/site/publish/contributing.html
phoenix/site/publish/develop.html
phoenix/site/publish/download.html
phoenix/site/publish/dynamic_columns.html
phoenix/site/publish/faq.html
phoenix/site/publish/flume.html
phoenix/site/publish/index.html
phoenix/site/publish/installation.html
phoenix/site/publish/issues.html
phoenix/site/publish/joins.html
phoenix/site/publish/language/datatypes.html
phoenix/site/publish/language/functions.html
phoenix/site/publish/language/index.html
phoenix/site/publish/mailing_list.html
phoenix/site/publish/multi-tenancy.html
phoenix/site/publish/news.html
phoenix/site/publish/paged.html
phoenix/site/publish/performance.html
phoenix/site/publish/pherf.html
phoenix/site/publish/phoenix_mr.html
phoenix/site/publish/phoenix_on_emr.html
phoenix/site/publish/phoenix_spark.html
phoenix/site/publish/pig_integration.html
phoenix/site/publish/recent.html
phoenix/site/publish/release.html
phoenix/site/publish/release_notes.html
phoenix/site/publish/resources.html
phoenix/site/publish/roadmap.html
phoenix/site/publish/rowtimestamp.html
phoenix/site/publish/salted.html
phoenix/site/publish/secondary_indexing.html
phoenix/site/publish/sequences.html
phoenix/site/publish/server.html
phoenix/site/publish/skip_scan.html
phoenix/site/publish/source.html
phoenix/site/publish/subqueries.html
phoenix/site/publish/team.html
phoenix/site/publish/tracing.html
phoenix/site/publish/transactions.html
phoenix/site/publish/tuning.html
phoenix/site/publish/udf.html
phoenix/site/publish/update_statistics.html
phoenix/site/publish/upgrading.html
phoenix/site/publish/views.html
phoenix/site/publish/who_is_using.html
phoenix/site/source/src/site/site.xml

Modified: phoenix/site/publish/Phoenix-in-15-minutes-or-less.html
URL: 
http://svn.apache.org/viewvc/phoenix/site/publish/Phoenix-in-15-minutes-or-less.html?rev=1728583=1728582=1728583=diff
==
--- phoenix/site/publish/Phoenix-in-15-minutes-or-less.html (original)
+++ phoenix/site/publish/Phoenix-in-15-minutes-or-less.html Fri Feb  5 01:29:14 
2016
@@ -1,7 +1,7 @@
 
 
 
 
@@ -89,7 +89,6 @@
Apache Pig 
Integration
Map Reduce 
Integration
Apache Flume Plugin
-   Amazon EMR 
Support



@@ -347,9 +346,6 @@ ORDER BY sum(population) DESC;

Apache Flume Plugin

-   
-   Amazon EMR Support
-   




Modified: phoenix/site/publish/array_type.html
URL: 
http://svn.apache.org/viewvc/phoenix/site/publish/array_type.html?rev=1728583=1728582=1728583=diff
==
--- phoenix/site/publish/array_type.html (original)
+++ phoenix/site/publish/array_type.html Fri Feb  5 01:29:14 2016
@@ -1,7 +1,7 @@
 
 
 
 
@@ -89,7 +89,6 @@
Apache Pig 
Integration
Map Reduce 
Integration
Apache Flume Plugin
-   Amazon EMR 
Support



@@ -347,9 +346,6 @@ SELECT region_name FROM regions WHERE '9

Apache Flume Plugin

Apache-Phoenix | 4.x-HBase-1.0 | Build Successful

2016-02-04 Thread Apache Jenkins Server
4.x-HBase-1.0 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.x-HBase-1.0

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.x-HBase-1.0/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.x-HBase-1.0/lastCompletedBuild/testReport/

Changes
[ravimagham] PHOENIX-2649 - GC/OOM during BulkLoad (Sergey Soldatov)



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


Jenkins build is back to normal : Phoenix | Master #1120

2016-02-04 Thread Apache Jenkins Server
See 



Build failed in Jenkins: Phoenix | Master #1119

2016-02-04 Thread Apache Jenkins Server
See 

Changes:

[ankitsinghal59] PHOENIX-2169 Illegal data error on UPSERT SELECT and JOIN with 
salted

--
[...truncated 317 lines...]
Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.068 sec - in 
org.apache.phoenix.filter.SkipScanFilterTest
Running org.apache.phoenix.filter.SkipScanBigFilterTest
Tests run: 35, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.314 sec - in 
org.apache.phoenix.expression.ArrayConcatFunctionTest
Running org.apache.phoenix.filter.SkipScanFilterIntersectTest
Tests run: 19, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.034 sec - in 
org.apache.phoenix.filter.SkipScanFilterIntersectTest
Running org.apache.phoenix.cache.JodaTimezoneCacheTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.045 sec - in 
org.apache.phoenix.cache.JodaTimezoneCacheTest
Running org.apache.phoenix.cache.TenantCacheTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec - in 
org.apache.phoenix.cache.TenantCacheTest
Running org.apache.phoenix.jdbc.ReadOnlyPropertiesTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec - in 
org.apache.phoenix.jdbc.ReadOnlyPropertiesTest
Running org.apache.phoenix.jdbc.PhoenixPreparedStatementTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.801 sec - in 
org.apache.phoenix.expression.GetSetByteBitFunctionTest
Running org.apache.phoenix.jdbc.PhoenixResultSetMetadataTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.227 sec - in 
org.apache.phoenix.jdbc.PhoenixPreparedStatementTest
Running org.apache.phoenix.jdbc.PhoenixEmbeddedDriverTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec - in 
org.apache.phoenix.jdbc.PhoenixEmbeddedDriverTest
Running org.apache.phoenix.jdbc.PhoenixDriverTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.638 sec - in 
org.apache.phoenix.filter.SkipScanBigFilterTest
Running org.apache.phoenix.index.IndexMaintainerTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.368 sec - in 
org.apache.phoenix.jdbc.PhoenixResultSetMetadataTest
Running org.apache.phoenix.trace.TraceMetricsSourceTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.344 sec - in 
org.apache.phoenix.jdbc.PhoenixDriverTest
Running org.apache.phoenix.execute.CorrelatePlanTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.107 sec - in 
org.apache.phoenix.execute.CorrelatePlanTest
Running org.apache.phoenix.execute.MutationStateTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec - in 
org.apache.phoenix.execute.MutationStateTest
Running org.apache.phoenix.execute.DescVarLengthFastByteComparisonsTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec - in 
org.apache.phoenix.execute.DescVarLengthFastByteComparisonsTest
Running org.apache.phoenix.execute.UnnestArrayPlanTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec - in 
org.apache.phoenix.execute.UnnestArrayPlanTest
Running org.apache.phoenix.compile.HavingCompilerTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.232 sec - in 
org.apache.phoenix.trace.TraceMetricsSourceTest
Running org.apache.phoenix.compile.StatementHintsCompilationTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.18 sec - in 
org.apache.phoenix.compile.StatementHintsCompilationTest
Running org.apache.phoenix.compile.ScanRangesIntersectTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec - in 
org.apache.phoenix.compile.ScanRangesIntersectTest
Running org.apache.phoenix.compile.QueryOptimizerTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.268 sec - in 
org.apache.phoenix.compile.HavingCompilerTest
Running org.apache.phoenix.compile.TenantSpecificViewIndexCompileTest
Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.656 sec - in 
org.apache.phoenix.index.IndexMaintainerTest
Running org.apache.phoenix.compile.QueryMetaDataTest
Tests run: 33, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.329 sec - in 
org.apache.phoenix.compile.QueryMetaDataTest
Running org.apache.phoenix.compile.JoinQueryCompilerTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.217 sec - in 
org.apache.phoenix.compile.JoinQueryCompilerTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.689 sec - in 
org.apache.phoenix.compile.TenantSpecificViewIndexCompileTest
Running org.apache.phoenix.compile.ViewCompilerTest
Running org.apache.phoenix.compile.WhereOptimizerTest
Tests run: 38, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.885 sec - in 
org.apache.phoenix.compile.QueryOptimizerTest
Running org.apache.phoenix.compile.QueryCompilerTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.251 sec - in