[1/2] phoenix git commit: PHOENIX-4471 Time related queries are failing

2018-01-08 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/5.x-HBase-2.0 d36d058a7 -> 1256e293a


PHOENIX-4471 Time related queries are failing


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 27d39078e223df1f70047c9eb74718b20258cce8
Parents: d36d058
Author: Ankit Singhal 
Authored: Tue Jan 9 12:33:19 2018 +0530
Committer: Ankit Singhal 
Committed: Tue Jan 9 12:33:19 2018 +0530

--
 .../src/it/java/org/apache/phoenix/end2end/PointInTimeQueryIT.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/27d39078/phoenix-core/src/it/java/org/apache/phoenix/end2end/PointInTimeQueryIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PointInTimeQueryIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PointInTimeQueryIT.java
index ed3e8a9..c53e523 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PointInTimeQueryIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PointInTimeQueryIT.java
@@ -63,7 +63,7 @@ public class PointInTimeQueryIT extends BaseQueryIT {
 public PointInTimeQueryIT(String idxDdl, boolean columnEncoded)
 throws Exception {
 // These queries fail without KEEP_DELETED_CELLS=true
-super(idxDdl, columnEncoded, false);
+super(idxDdl, columnEncoded, true);
 }
 
 @Test



[2/2] phoenix git commit: PHOENIX-4496 Fix RowValueConstructorIT and IndexMetadataIT

2018-01-08 Thread ankit
PHOENIX-4496 Fix RowValueConstructorIT and IndexMetadataIT


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 1256e293a2cb3a1dd64c587c97adc6f0ee951ad8
Parents: 27d3907
Author: Ankit Singhal 
Authored: Tue Jan 9 13:22:35 2018 +0530
Committer: Ankit Singhal 
Committed: Tue Jan 9 13:22:35 2018 +0530

--
 .../phoenix/hbase/index/scanner/ScannerBuilder.java   | 10 ++
 1 file changed, 10 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1256e293/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/scanner/ScannerBuilder.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/scanner/ScannerBuilder.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/scanner/ScannerBuilder.java
index ad09c0c..4c42fe4 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/scanner/ScannerBuilder.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/scanner/ScannerBuilder.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.hbase.filter.BinaryComparator;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
 import org.apache.hadoop.hbase.filter.FamilyFilter;
 import org.apache.hadoop.hbase.filter.Filter;
+import org.apache.hadoop.hbase.filter.FilterBase;
 import org.apache.hadoop.hbase.filter.FilterList;
 import org.apache.hadoop.hbase.filter.QualifierFilter;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -98,6 +99,15 @@ public class ScannerBuilder {
   }
   columnFilters.addFilter(columnFilter);
 }
+
+if(columns.isEmpty()){
+columnFilters.addFilter(new FilterBase(){
+@Override
+public boolean filterAllRemaining() throws IOException {
+return true;
+}
+});
+}
 return columnFilters;
   }
 



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

2018-01-08 Thread Apache Jenkins Server
See 




Build failed in Jenkins: Phoenix | 4.x-HBase-0.98 #1792

2018-01-08 Thread Apache Jenkins Server
See 


Changes:

[maryannxue] PHOENIX-4508 Order-by not optimized in sort-merge-join on salted 
tables

--
[...truncated 80.56 KB...]
[INFO] Running org.apache.phoenix.end2end.DistinctCountIT
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 21.405 
s - in org.apache.phoenix.end2end.DistinctCountIT
[INFO] Running org.apache.phoenix.end2end.DistinctPrefixFilterIT
[INFO] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 46.913 
s - in org.apache.phoenix.end2end.DerivedTableIT
[INFO] Running org.apache.phoenix.end2end.DynamicColumnIT
[INFO] Tests run: 28, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 99.201 
s - in org.apache.phoenix.end2end.DeleteIT
[INFO] Running org.apache.phoenix.end2end.DynamicFamilyIT
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.352 s 
- in org.apache.phoenix.end2end.DynamicFamilyIT
[INFO] Running org.apache.phoenix.end2end.DynamicUpsertIT
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 36.996 s 
- in org.apache.phoenix.end2end.DynamicColumnIT
[INFO] Running org.apache.phoenix.end2end.EncodeFunctionIT
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.997 s 
- in org.apache.phoenix.end2end.DynamicUpsertIT
[INFO] Running org.apache.phoenix.end2end.EvaluationOfORIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.668 s 
- in org.apache.phoenix.end2end.EvaluationOfORIT
[INFO] Running org.apache.phoenix.end2end.ExecuteStatementsIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 15.87 s 
- in org.apache.phoenix.end2end.ExecuteStatementsIT
[INFO] Running org.apache.phoenix.end2end.ExpFunctionEnd2EndIT
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 21.519 s 
- in org.apache.phoenix.end2end.EncodeFunctionIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.315 s 
- in org.apache.phoenix.end2end.ExpFunctionEnd2EndIT
[INFO] Running org.apache.phoenix.end2end.ExtendedQueryExecIT
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.865 s 
- in org.apache.phoenix.end2end.ExtendedQueryExecIT
[INFO] Running org.apache.phoenix.end2end.FirstValueFunctionIT
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.614 s 
- in org.apache.phoenix.end2end.FirstValueFunctionIT
[INFO] Running org.apache.phoenix.end2end.ExplainPlanWithStatsDisabledIT
[INFO] Tests run: 13, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.524 
s - in org.apache.phoenix.end2end.ExplainPlanWithStatsDisabledIT
[INFO] Running org.apache.phoenix.end2end.FlappingAlterTableIT
[INFO] Running org.apache.phoenix.end2end.FirstValuesFunctionIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.766 s 
- in org.apache.phoenix.end2end.FlappingAlterTableIT
[INFO] Running org.apache.phoenix.end2end.FunkyNamesIT
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 132.026 
s - in org.apache.phoenix.end2end.DistinctPrefixFilterIT
[INFO] Running org.apache.phoenix.end2end.GetSetByteBitFunctionEnd2EndIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.944 s 
- in org.apache.phoenix.end2end.GetSetByteBitFunctionEnd2EndIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.876 s 
- in org.apache.phoenix.end2end.FunkyNamesIT
[INFO] Running org.apache.phoenix.end2end.ImmutableTablePropertiesIT
[INFO] Running org.apache.phoenix.end2end.GroupByIT
[INFO] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 16.75 s 
- in org.apache.phoenix.end2end.FirstValuesFunctionIT
[INFO] Running org.apache.phoenix.end2end.InListIT
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.666 s 
- in org.apache.phoenix.end2end.ImmutableTablePropertiesIT
[INFO] Running org.apache.phoenix.end2end.InQueryIT
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 889, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-failsafe-plugin:2.20:integration-test (HBaseManagedTimeTests) 
@ phoenix-core ---
[INFO] 
[INFO] ---
[INFO]  T E S T S
[INFO] ---
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-failsafe-plugin:2.20:integration-test 
(NeedTheirOwnClusterTests) @ phoenix-core ---
[INFO] 
[INFO] ---
[INFO]  T E S T S
[INFO] ---
[INFO] Running 
org.apache.hadoop.hbase.regionserver.wal.WALReplayWithIndexWritesAndCompressedWALIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 51.832 s 
- in 
org.apache.hadoop.hbase.regionserver.wal.WALReplayWithIndexWritesAndCompressedWALIT
[INFO] Running 

phoenix git commit: PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables

2018-01-08 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.13-HBase-1.3 3f627f005 -> 8fd577f3f


PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables


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

Branch: refs/heads/4.13-HBase-1.3
Commit: 8fd577f3fe3ea6d9f678e29df16ffd1f6ae6744c
Parents: 3f627f0
Author: maryannxue 
Authored: Mon Jan 8 11:30:07 2018 -0800
Committer: maryannxue 
Committed: Mon Jan 8 11:30:07 2018 -0800

--
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 108 +++
 .../compile/TupleProjectionCompiler.java|   7 +-
 2 files changed, 111 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8fd577f3/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
index e61332b..a132728 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
@@ -634,4 +634,112 @@ public class SortMergeJoinMoreIT extends 
ParallelStatsDisabledIT {
 }
 }
 }
+
+@Test
+public void testBug4508() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty("TenantId", "010");
+Connection conn010 = DriverManager.getConnection(getUrl(), props);
+try {
+// Salted tables
+String peopleTable = generateUniqueName();
+String myTable = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable + " 
(\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (PERSON_ID)) 
SALT_BUCKETS = 3");
+conn.createStatement().execute("CREATE TABLE " + myTable + " (\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (LOCALID, DSID)) 
SALT_BUCKETS = 3");
+verifyQueryPlanAndResultForBug4508(conn, peopleTable, myTable);
+
+// Salted multi-tenant tables
+String peopleTable2 = generateUniqueName();
+String myTable2 = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable2 + " 
(\n" +
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (TENANT_ID, 
PERSON_ID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+conn.createStatement().execute("CREATE TABLE " + myTable2 + " (\n" 
+
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (TENANT_ID, LOCALID, 
DSID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+verifyQueryPlanAndResultForBug4508(conn010, peopleTable2, 
myTable2);
+} finally {
+conn.close();
+conn010.close();
+}
+}
+
+private static void verifyQueryPlanAndResultForBug4508(
+Connection conn, String peopleTable, String myTable) throws 
Exception {
+PreparedStatement peopleTableUpsertStmt = conn.prepareStatement(
+"UPSERT INTO " + peopleTable + " VALUES(?, ?)");
+peopleTableUpsertStmt.setString(1, "X001");
+peopleTableUpsertStmt.setString(2, "Marcus");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X002");
+peopleTableUpsertStmt.setString(2, "Jenny");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X003");
+peopleTableUpsertStmt.setString(2, "Seymour");
+peopleTableUpsertStmt.execute();
+conn.commit();
+
+

phoenix git commit: PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables

2018-01-08 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.13-HBase-1.2 05fa73891 -> 75d098f07


PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables


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

Branch: refs/heads/4.13-HBase-1.2
Commit: 75d098f07055ca862d656a1eee38015750576238
Parents: 05fa738
Author: maryannxue 
Authored: Mon Jan 8 11:29:37 2018 -0800
Committer: maryannxue 
Committed: Mon Jan 8 11:29:37 2018 -0800

--
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 108 +++
 .../compile/TupleProjectionCompiler.java|   7 +-
 2 files changed, 111 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/75d098f0/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
index e61332b..a132728 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
@@ -634,4 +634,112 @@ public class SortMergeJoinMoreIT extends 
ParallelStatsDisabledIT {
 }
 }
 }
+
+@Test
+public void testBug4508() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty("TenantId", "010");
+Connection conn010 = DriverManager.getConnection(getUrl(), props);
+try {
+// Salted tables
+String peopleTable = generateUniqueName();
+String myTable = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable + " 
(\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (PERSON_ID)) 
SALT_BUCKETS = 3");
+conn.createStatement().execute("CREATE TABLE " + myTable + " (\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (LOCALID, DSID)) 
SALT_BUCKETS = 3");
+verifyQueryPlanAndResultForBug4508(conn, peopleTable, myTable);
+
+// Salted multi-tenant tables
+String peopleTable2 = generateUniqueName();
+String myTable2 = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable2 + " 
(\n" +
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (TENANT_ID, 
PERSON_ID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+conn.createStatement().execute("CREATE TABLE " + myTable2 + " (\n" 
+
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (TENANT_ID, LOCALID, 
DSID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+verifyQueryPlanAndResultForBug4508(conn010, peopleTable2, 
myTable2);
+} finally {
+conn.close();
+conn010.close();
+}
+}
+
+private static void verifyQueryPlanAndResultForBug4508(
+Connection conn, String peopleTable, String myTable) throws 
Exception {
+PreparedStatement peopleTableUpsertStmt = conn.prepareStatement(
+"UPSERT INTO " + peopleTable + " VALUES(?, ?)");
+peopleTableUpsertStmt.setString(1, "X001");
+peopleTableUpsertStmt.setString(2, "Marcus");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X002");
+peopleTableUpsertStmt.setString(2, "Jenny");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X003");
+peopleTableUpsertStmt.setString(2, "Seymour");
+peopleTableUpsertStmt.execute();
+conn.commit();
+
+

phoenix git commit: PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables

2018-01-08 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.13-HBase-1.1 3a7c4920d -> 2e174be96


PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables


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

Branch: refs/heads/4.13-HBase-1.1
Commit: 2e174be96a01c66b4e86bff5d9942a00b998e094
Parents: 3a7c492
Author: maryannxue 
Authored: Mon Jan 8 11:28:17 2018 -0800
Committer: maryannxue 
Committed: Mon Jan 8 11:28:17 2018 -0800

--
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 108 +++
 .../compile/TupleProjectionCompiler.java|   7 +-
 2 files changed, 111 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2e174be9/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
index e61332b..a132728 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
@@ -634,4 +634,112 @@ public class SortMergeJoinMoreIT extends 
ParallelStatsDisabledIT {
 }
 }
 }
+
+@Test
+public void testBug4508() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty("TenantId", "010");
+Connection conn010 = DriverManager.getConnection(getUrl(), props);
+try {
+// Salted tables
+String peopleTable = generateUniqueName();
+String myTable = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable + " 
(\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (PERSON_ID)) 
SALT_BUCKETS = 3");
+conn.createStatement().execute("CREATE TABLE " + myTable + " (\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (LOCALID, DSID)) 
SALT_BUCKETS = 3");
+verifyQueryPlanAndResultForBug4508(conn, peopleTable, myTable);
+
+// Salted multi-tenant tables
+String peopleTable2 = generateUniqueName();
+String myTable2 = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable2 + " 
(\n" +
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (TENANT_ID, 
PERSON_ID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+conn.createStatement().execute("CREATE TABLE " + myTable2 + " (\n" 
+
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (TENANT_ID, LOCALID, 
DSID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+verifyQueryPlanAndResultForBug4508(conn010, peopleTable2, 
myTable2);
+} finally {
+conn.close();
+conn010.close();
+}
+}
+
+private static void verifyQueryPlanAndResultForBug4508(
+Connection conn, String peopleTable, String myTable) throws 
Exception {
+PreparedStatement peopleTableUpsertStmt = conn.prepareStatement(
+"UPSERT INTO " + peopleTable + " VALUES(?, ?)");
+peopleTableUpsertStmt.setString(1, "X001");
+peopleTableUpsertStmt.setString(2, "Marcus");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X002");
+peopleTableUpsertStmt.setString(2, "Jenny");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X003");
+peopleTableUpsertStmt.setString(2, "Seymour");
+peopleTableUpsertStmt.execute();
+conn.commit();
+
+

phoenix git commit: PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables

2018-01-08 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.13-HBase-0.98 5fffaca72 -> f87509727


PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables


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

Branch: refs/heads/4.13-HBase-0.98
Commit: f87509727f1571be2a8964aff4cf2b1e2a627456
Parents: 5fffaca
Author: maryannxue 
Authored: Mon Jan 8 11:26:58 2018 -0800
Committer: maryannxue 
Committed: Mon Jan 8 11:26:58 2018 -0800

--
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 108 +++
 .../compile/TupleProjectionCompiler.java|   7 +-
 2 files changed, 111 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f8750972/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
index e61332b..a132728 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
@@ -634,4 +634,112 @@ public class SortMergeJoinMoreIT extends 
ParallelStatsDisabledIT {
 }
 }
 }
+
+@Test
+public void testBug4508() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty("TenantId", "010");
+Connection conn010 = DriverManager.getConnection(getUrl(), props);
+try {
+// Salted tables
+String peopleTable = generateUniqueName();
+String myTable = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable + " 
(\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (PERSON_ID)) 
SALT_BUCKETS = 3");
+conn.createStatement().execute("CREATE TABLE " + myTable + " (\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (LOCALID, DSID)) 
SALT_BUCKETS = 3");
+verifyQueryPlanAndResultForBug4508(conn, peopleTable, myTable);
+
+// Salted multi-tenant tables
+String peopleTable2 = generateUniqueName();
+String myTable2 = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable2 + " 
(\n" +
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (TENANT_ID, 
PERSON_ID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+conn.createStatement().execute("CREATE TABLE " + myTable2 + " (\n" 
+
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (TENANT_ID, LOCALID, 
DSID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+verifyQueryPlanAndResultForBug4508(conn010, peopleTable2, 
myTable2);
+} finally {
+conn.close();
+conn010.close();
+}
+}
+
+private static void verifyQueryPlanAndResultForBug4508(
+Connection conn, String peopleTable, String myTable) throws 
Exception {
+PreparedStatement peopleTableUpsertStmt = conn.prepareStatement(
+"UPSERT INTO " + peopleTable + " VALUES(?, ?)");
+peopleTableUpsertStmt.setString(1, "X001");
+peopleTableUpsertStmt.setString(2, "Marcus");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X002");
+peopleTableUpsertStmt.setString(2, "Jenny");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X003");
+peopleTableUpsertStmt.setString(2, "Seymour");
+peopleTableUpsertStmt.execute();
+conn.commit();
+
+

phoenix git commit: PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables

2018-01-08 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.13-cdh5.11.2 868fdaacd -> 506696f5e


PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables


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

Branch: refs/heads/4.13-cdh5.11.2
Commit: 506696f5e73220ea04ed92fc5fd57de0c6d36f59
Parents: 868fdaa
Author: maryannxue 
Authored: Mon Jan 8 11:26:15 2018 -0800
Committer: maryannxue 
Committed: Mon Jan 8 11:26:15 2018 -0800

--
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 108 +++
 .../compile/TupleProjectionCompiler.java|   7 +-
 2 files changed, 111 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/506696f5/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
index e61332b..a132728 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
@@ -634,4 +634,112 @@ public class SortMergeJoinMoreIT extends 
ParallelStatsDisabledIT {
 }
 }
 }
+
+@Test
+public void testBug4508() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty("TenantId", "010");
+Connection conn010 = DriverManager.getConnection(getUrl(), props);
+try {
+// Salted tables
+String peopleTable = generateUniqueName();
+String myTable = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable + " 
(\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (PERSON_ID)) 
SALT_BUCKETS = 3");
+conn.createStatement().execute("CREATE TABLE " + myTable + " (\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (LOCALID, DSID)) 
SALT_BUCKETS = 3");
+verifyQueryPlanAndResultForBug4508(conn, peopleTable, myTable);
+
+// Salted multi-tenant tables
+String peopleTable2 = generateUniqueName();
+String myTable2 = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable2 + " 
(\n" +
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (TENANT_ID, 
PERSON_ID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+conn.createStatement().execute("CREATE TABLE " + myTable2 + " (\n" 
+
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (TENANT_ID, LOCALID, 
DSID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+verifyQueryPlanAndResultForBug4508(conn010, peopleTable2, 
myTable2);
+} finally {
+conn.close();
+conn010.close();
+}
+}
+
+private static void verifyQueryPlanAndResultForBug4508(
+Connection conn, String peopleTable, String myTable) throws 
Exception {
+PreparedStatement peopleTableUpsertStmt = conn.prepareStatement(
+"UPSERT INTO " + peopleTable + " VALUES(?, ?)");
+peopleTableUpsertStmt.setString(1, "X001");
+peopleTableUpsertStmt.setString(2, "Marcus");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X002");
+peopleTableUpsertStmt.setString(2, "Jenny");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X003");
+peopleTableUpsertStmt.setString(2, "Seymour");
+peopleTableUpsertStmt.execute();
+conn.commit();
+
+

phoenix git commit: PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables

2018-01-08 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/5.x-HBase-2.0 fdf4d0a69 -> d36d058a7


PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables


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

Branch: refs/heads/5.x-HBase-2.0
Commit: d36d058a72899eea2c47bca062c4eeaa75d4257c
Parents: fdf4d0a
Author: maryannxue 
Authored: Mon Jan 8 11:21:06 2018 -0800
Committer: maryannxue 
Committed: Mon Jan 8 11:21:06 2018 -0800

--
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 108 +++
 .../compile/TupleProjectionCompiler.java|   7 +-
 2 files changed, 111 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d36d058a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
index e61332b..a132728 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
@@ -634,4 +634,112 @@ public class SortMergeJoinMoreIT extends 
ParallelStatsDisabledIT {
 }
 }
 }
+
+@Test
+public void testBug4508() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty("TenantId", "010");
+Connection conn010 = DriverManager.getConnection(getUrl(), props);
+try {
+// Salted tables
+String peopleTable = generateUniqueName();
+String myTable = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable + " 
(\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (PERSON_ID)) 
SALT_BUCKETS = 3");
+conn.createStatement().execute("CREATE TABLE " + myTable + " (\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (LOCALID, DSID)) 
SALT_BUCKETS = 3");
+verifyQueryPlanAndResultForBug4508(conn, peopleTable, myTable);
+
+// Salted multi-tenant tables
+String peopleTable2 = generateUniqueName();
+String myTable2 = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable2 + " 
(\n" +
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (TENANT_ID, 
PERSON_ID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+conn.createStatement().execute("CREATE TABLE " + myTable2 + " (\n" 
+
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (TENANT_ID, LOCALID, 
DSID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+verifyQueryPlanAndResultForBug4508(conn010, peopleTable2, 
myTable2);
+} finally {
+conn.close();
+conn010.close();
+}
+}
+
+private static void verifyQueryPlanAndResultForBug4508(
+Connection conn, String peopleTable, String myTable) throws 
Exception {
+PreparedStatement peopleTableUpsertStmt = conn.prepareStatement(
+"UPSERT INTO " + peopleTable + " VALUES(?, ?)");
+peopleTableUpsertStmt.setString(1, "X001");
+peopleTableUpsertStmt.setString(2, "Marcus");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X002");
+peopleTableUpsertStmt.setString(2, "Jenny");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X003");
+peopleTableUpsertStmt.setString(2, "Seymour");
+peopleTableUpsertStmt.execute();
+conn.commit();
+
+

Build failed in Jenkins: Phoenix-4.x-HBase-1.1 #645

2018-01-08 Thread Apache Jenkins Server
See 


Changes:

[maryannxue] PHOENIX-4508 Order-by not optimized in sort-merge-join on salted 
tables

--
Started by an SCM change
Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on H32 (ubuntu xenial) in workspace 

Cloning the remote Git repository
Cloning repository https://git-wip-us.apache.org/repos/asf/phoenix.git
 > git init  # 
 > timeout=10
Fetching upstream changes from 
https://git-wip-us.apache.org/repos/asf/phoenix.git
 > git --version # timeout=10
 > git fetch --tags --progress 
 > https://git-wip-us.apache.org/repos/asf/phoenix.git 
 > +refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url 
 > https://git-wip-us.apache.org/repos/asf/phoenix.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # 
 > timeout=10
 > git config remote.origin.url 
 > https://git-wip-us.apache.org/repos/asf/phoenix.git # timeout=10
Fetching upstream changes from 
https://git-wip-us.apache.org/repos/asf/phoenix.git
 > git fetch --tags --progress 
 > https://git-wip-us.apache.org/repos/asf/phoenix.git 
 > +refs/heads/*:refs/remotes/origin/*
 > git rev-parse origin/4.x-HBase-1.1^{commit} # timeout=10
Checking out Revision 8acdf98c171ed8755e980042963867e3e74915a5 
(origin/4.x-HBase-1.1)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 8acdf98c171ed8755e980042963867e3e74915a5
Commit message: "PHOENIX-4508 Order-by not optimized in sort-merge-join on 
salted tables"
 > git rev-list a2eaaa263a2cdeb6aa3e5e044224061e1a9b5109 # timeout=10
No emails were triggered.
[EnvInject] - Executing scripts and injecting environment variables after the 
SCM step.
[EnvInject] - Injecting as environment variables the properties content 
MAVEN_OPTS=-Xmx3G

[EnvInject] - Variables injected successfully.
[Phoenix-4.x-HBase-1.1] $ /bin/bash -xe /tmp/jenkins1928716353635071427.sh
+ echo 'DELETING ~/.m2/repository/org/apache/htrace. See 
https://issues.apache.org/jira/browse/PHOENIX-1802'
DELETING ~/.m2/repository/org/apache/htrace. See 
https://issues.apache.org/jira/browse/PHOENIX-1802
+ echo 'CURRENT CONTENT:'
CURRENT CONTENT:
+ ls /home/jenkins/.m2/repository/org/apache/htrace
htrace
htrace-core
[Phoenix-4.x-HBase-1.1] $ /home/jenkins/tools/maven/latest3/bin/mvn -U clean 
install -Dcheckstyle.skip=true
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-core:jar:4.14.0-HBase-1.1-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter. @ 
org.apache.phoenix:phoenix-core:[unknown-version], 
 
line 65, column 23
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-flume:jar:4.14.0-HBase-1.1-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-kafka:jar:4.14.0-HBase-1.1-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter. @ 
org.apache.phoenix:phoenix-kafka:[unknown-version], 
 
line 349, column 20
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-pig:jar:4.14.0-HBase-1.1-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-queryserver-client:jar:4.14.0-HBase-1.1-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-queryserver:jar:4.14.0-HBase-1.1-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-pherf:jar:4.14.0-HBase-1.1-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-spark:jar:4.14.0-HBase-1.1-SNAPSHOT
[WARNING] 

Build failed in Jenkins: Phoenix-4.x-HBase-1.2 #239

2018-01-08 Thread Apache Jenkins Server
See 


Changes:

[maryannxue] PHOENIX-4508 Order-by not optimized in sort-merge-join on salted 
tables

--
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on H32 (ubuntu xenial) in workspace 

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url 
 > https://git-wip-us.apache.org/repos/asf/phoenix.git # timeout=10
Fetching upstream changes from 
https://git-wip-us.apache.org/repos/asf/phoenix.git
 > git --version # timeout=10
 > git fetch --tags --progress 
 > https://git-wip-us.apache.org/repos/asf/phoenix.git 
 > +refs/heads/*:refs/remotes/origin/*
 > git rev-parse origin/4.x-HBase-1.2^{commit} # timeout=10
Checking out Revision b49dcbde12b269d1f89569dc01565ba54a1d801d 
(origin/4.x-HBase-1.2)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f b49dcbde12b269d1f89569dc01565ba54a1d801d
Commit message: "PHOENIX-4508 Order-by not optimized in sort-merge-join on 
salted tables"
 > git rev-list 81748b2ea841283f2ce96e767b0d0db982727489 # timeout=10
No emails were triggered.
[EnvInject] - Executing scripts and injecting environment variables after the 
SCM step.
[EnvInject] - Injecting as environment variables the properties content 
MAVEN_OPTS=-Xmx3G

[EnvInject] - Variables injected successfully.
[Phoenix-4.x-HBase-1.2] $ /bin/bash -xe /tmp/jenkins1559076882726866564.sh
+ echo 'DELETING ~/.m2/repository/org/apache/htrace. See 
https://issues.apache.org/jira/browse/PHOENIX-1802'
DELETING ~/.m2/repository/org/apache/htrace. See 
https://issues.apache.org/jira/browse/PHOENIX-1802
+ echo 'CURRENT CONTENT:'
CURRENT CONTENT:
+ ls /home/jenkins/.m2/repository/org/apache/htrace
htrace
htrace-core
[Phoenix-4.x-HBase-1.2] $ /home/jenkins/tools/maven/latest3/bin/mvn -U clean 
install -Dcheckstyle.skip=true
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-core:jar:4.14.0-HBase-1.2-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter. @ 
org.apache.phoenix:phoenix-core:[unknown-version], 
 
line 65, column 23
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-flume:jar:4.14.0-HBase-1.2-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-kafka:jar:4.14.0-HBase-1.2-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter. @ 
org.apache.phoenix:phoenix-kafka:[unknown-version], 
 
line 349, column 20
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-pig:jar:4.14.0-HBase-1.2-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-queryserver-client:jar:4.14.0-HBase-1.2-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-queryserver:jar:4.14.0-HBase-1.2-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-pherf:jar:4.14.0-HBase-1.2-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-spark:jar:4.14.0-HBase-1.2-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.phoenix:phoenix-hive:jar:4.14.0-HBase-1.2-SNAPSHOT
[WARNING] Reporting configuration should be done in  section, not in 
maven-site-plugin  as reportPlugins parameter.
[WARNING] 
[WARNING] Some problems were encountered while building the 

phoenix git commit: PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables

2018-01-08 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.11.2 ddb69e14b -> 5fbdab5b7


PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables


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

Branch: refs/heads/4.x-cdh5.11.2
Commit: 5fbdab5b7f1bbdac25f1a238c1bfd302351f525d
Parents: ddb69e1
Author: maryannxue 
Authored: Mon Jan 8 11:15:05 2018 -0800
Committer: maryannxue 
Committed: Mon Jan 8 11:15:05 2018 -0800

--
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 108 +++
 .../compile/TupleProjectionCompiler.java|   7 +-
 2 files changed, 111 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5fbdab5b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
index e61332b..a132728 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
@@ -634,4 +634,112 @@ public class SortMergeJoinMoreIT extends 
ParallelStatsDisabledIT {
 }
 }
 }
+
+@Test
+public void testBug4508() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty("TenantId", "010");
+Connection conn010 = DriverManager.getConnection(getUrl(), props);
+try {
+// Salted tables
+String peopleTable = generateUniqueName();
+String myTable = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable + " 
(\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (PERSON_ID)) 
SALT_BUCKETS = 3");
+conn.createStatement().execute("CREATE TABLE " + myTable + " (\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (LOCALID, DSID)) 
SALT_BUCKETS = 3");
+verifyQueryPlanAndResultForBug4508(conn, peopleTable, myTable);
+
+// Salted multi-tenant tables
+String peopleTable2 = generateUniqueName();
+String myTable2 = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable2 + " 
(\n" +
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (TENANT_ID, 
PERSON_ID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+conn.createStatement().execute("CREATE TABLE " + myTable2 + " (\n" 
+
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (TENANT_ID, LOCALID, 
DSID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+verifyQueryPlanAndResultForBug4508(conn010, peopleTable2, 
myTable2);
+} finally {
+conn.close();
+conn010.close();
+}
+}
+
+private static void verifyQueryPlanAndResultForBug4508(
+Connection conn, String peopleTable, String myTable) throws 
Exception {
+PreparedStatement peopleTableUpsertStmt = conn.prepareStatement(
+"UPSERT INTO " + peopleTable + " VALUES(?, ?)");
+peopleTableUpsertStmt.setString(1, "X001");
+peopleTableUpsertStmt.setString(2, "Marcus");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X002");
+peopleTableUpsertStmt.setString(2, "Jenny");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X003");
+peopleTableUpsertStmt.setString(2, "Seymour");
+peopleTableUpsertStmt.execute();
+conn.commit();
+
+

phoenix git commit: PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables

2018-01-08 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 a2eaaa263 -> 8acdf98c1


PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 8acdf98c171ed8755e980042963867e3e74915a5
Parents: a2eaaa2
Author: maryannxue 
Authored: Mon Jan 8 11:09:33 2018 -0800
Committer: maryannxue 
Committed: Mon Jan 8 11:09:33 2018 -0800

--
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 108 +++
 .../compile/TupleProjectionCompiler.java|   7 +-
 2 files changed, 111 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8acdf98c/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
index e61332b..a132728 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
@@ -634,4 +634,112 @@ public class SortMergeJoinMoreIT extends 
ParallelStatsDisabledIT {
 }
 }
 }
+
+@Test
+public void testBug4508() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty("TenantId", "010");
+Connection conn010 = DriverManager.getConnection(getUrl(), props);
+try {
+// Salted tables
+String peopleTable = generateUniqueName();
+String myTable = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable + " 
(\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (PERSON_ID)) 
SALT_BUCKETS = 3");
+conn.createStatement().execute("CREATE TABLE " + myTable + " (\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (LOCALID, DSID)) 
SALT_BUCKETS = 3");
+verifyQueryPlanAndResultForBug4508(conn, peopleTable, myTable);
+
+// Salted multi-tenant tables
+String peopleTable2 = generateUniqueName();
+String myTable2 = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable2 + " 
(\n" +
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (TENANT_ID, 
PERSON_ID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+conn.createStatement().execute("CREATE TABLE " + myTable2 + " (\n" 
+
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (TENANT_ID, LOCALID, 
DSID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+verifyQueryPlanAndResultForBug4508(conn010, peopleTable2, 
myTable2);
+} finally {
+conn.close();
+conn010.close();
+}
+}
+
+private static void verifyQueryPlanAndResultForBug4508(
+Connection conn, String peopleTable, String myTable) throws 
Exception {
+PreparedStatement peopleTableUpsertStmt = conn.prepareStatement(
+"UPSERT INTO " + peopleTable + " VALUES(?, ?)");
+peopleTableUpsertStmt.setString(1, "X001");
+peopleTableUpsertStmt.setString(2, "Marcus");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X002");
+peopleTableUpsertStmt.setString(2, "Jenny");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X003");
+peopleTableUpsertStmt.setString(2, "Seymour");
+peopleTableUpsertStmt.execute();
+conn.commit();
+
+

phoenix git commit: PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables

2018-01-08 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 81748b2ea -> b49dcbde1


PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables


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

Branch: refs/heads/4.x-HBase-1.2
Commit: b49dcbde12b269d1f89569dc01565ba54a1d801d
Parents: 81748b2
Author: maryannxue 
Authored: Mon Jan 8 11:07:08 2018 -0800
Committer: maryannxue 
Committed: Mon Jan 8 11:07:08 2018 -0800

--
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 108 +++
 .../compile/TupleProjectionCompiler.java|   7 +-
 2 files changed, 111 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b49dcbde/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
index e61332b..a132728 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
@@ -634,4 +634,112 @@ public class SortMergeJoinMoreIT extends 
ParallelStatsDisabledIT {
 }
 }
 }
+
+@Test
+public void testBug4508() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty("TenantId", "010");
+Connection conn010 = DriverManager.getConnection(getUrl(), props);
+try {
+// Salted tables
+String peopleTable = generateUniqueName();
+String myTable = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable + " 
(\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (PERSON_ID)) 
SALT_BUCKETS = 3");
+conn.createStatement().execute("CREATE TABLE " + myTable + " (\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (LOCALID, DSID)) 
SALT_BUCKETS = 3");
+verifyQueryPlanAndResultForBug4508(conn, peopleTable, myTable);
+
+// Salted multi-tenant tables
+String peopleTable2 = generateUniqueName();
+String myTable2 = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable2 + " 
(\n" +
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (TENANT_ID, 
PERSON_ID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+conn.createStatement().execute("CREATE TABLE " + myTable2 + " (\n" 
+
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (TENANT_ID, LOCALID, 
DSID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+verifyQueryPlanAndResultForBug4508(conn010, peopleTable2, 
myTable2);
+} finally {
+conn.close();
+conn010.close();
+}
+}
+
+private static void verifyQueryPlanAndResultForBug4508(
+Connection conn, String peopleTable, String myTable) throws 
Exception {
+PreparedStatement peopleTableUpsertStmt = conn.prepareStatement(
+"UPSERT INTO " + peopleTable + " VALUES(?, ?)");
+peopleTableUpsertStmt.setString(1, "X001");
+peopleTableUpsertStmt.setString(2, "Marcus");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X002");
+peopleTableUpsertStmt.setString(2, "Jenny");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X003");
+peopleTableUpsertStmt.setString(2, "Seymour");
+peopleTableUpsertStmt.execute();
+conn.commit();
+
+

phoenix git commit: PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables

2018-01-08 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 a2b218e8d -> 488389e73


PHOENIX-4508 Order-by not optimized in sort-merge-join on salted tables


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 488389e73575782f58be78baeb7410cdb6f1b17b
Parents: a2b218e
Author: maryannxue 
Authored: Mon Jan 8 11:04:11 2018 -0800
Committer: maryannxue 
Committed: Mon Jan 8 11:04:11 2018 -0800

--
 .../phoenix/end2end/SortMergeJoinMoreIT.java| 108 +++
 .../compile/TupleProjectionCompiler.java|   7 +-
 2 files changed, 111 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/488389e7/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
index e61332b..a132728 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java
@@ -634,4 +634,112 @@ public class SortMergeJoinMoreIT extends 
ParallelStatsDisabledIT {
 }
 }
 }
+
+@Test
+public void testBug4508() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty("TenantId", "010");
+Connection conn010 = DriverManager.getConnection(getUrl(), props);
+try {
+// Salted tables
+String peopleTable = generateUniqueName();
+String myTable = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable + " 
(\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (PERSON_ID)) 
SALT_BUCKETS = 3");
+conn.createStatement().execute("CREATE TABLE " + myTable + " (\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (LOCALID, DSID)) 
SALT_BUCKETS = 3");
+verifyQueryPlanAndResultForBug4508(conn, peopleTable, myTable);
+
+// Salted multi-tenant tables
+String peopleTable2 = generateUniqueName();
+String myTable2 = generateUniqueName();
+conn.createStatement().execute("CREATE TABLE " + peopleTable2 + " 
(\n" +
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"PERSON_ID VARCHAR NOT NULL,\n" +
+"NAME VARCHAR\n" +
+"CONSTRAINT PK_TEST_PEOPLE PRIMARY KEY (TENANT_ID, 
PERSON_ID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+conn.createStatement().execute("CREATE TABLE " + myTable2 + " (\n" 
+
+"TENANT_ID VARCHAR NOT NULL,\n" +
+"LOCALID VARCHAR NOT NULL,\n" +
+"DSID VARCHAR(255) NOT NULL, \n" +
+"EID CHAR(40),\n" +
+"HAS_CANDIDATES BOOLEAN\n" +
+"CONSTRAINT PK_MYTABLE PRIMARY KEY (TENANT_ID, LOCALID, 
DSID))\n" +
+"SALT_BUCKETS = 3, MULTI_TENANT=true");
+verifyQueryPlanAndResultForBug4508(conn010, peopleTable2, 
myTable2);
+} finally {
+conn.close();
+conn010.close();
+}
+}
+
+private static void verifyQueryPlanAndResultForBug4508(
+Connection conn, String peopleTable, String myTable) throws 
Exception {
+PreparedStatement peopleTableUpsertStmt = conn.prepareStatement(
+"UPSERT INTO " + peopleTable + " VALUES(?, ?)");
+peopleTableUpsertStmt.setString(1, "X001");
+peopleTableUpsertStmt.setString(2, "Marcus");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X002");
+peopleTableUpsertStmt.setString(2, "Jenny");
+peopleTableUpsertStmt.execute();
+peopleTableUpsertStmt.setString(1, "X003");
+peopleTableUpsertStmt.setString(2, "Seymour");
+peopleTableUpsertStmt.execute();
+conn.commit();
+
+

Build failed in Jenkins: Phoenix Compile Compatibility with HBase #511

2018-01-08 Thread Apache Jenkins Server
See 


--
Started by timer
[EnvInject] - Loading node environment variables.
Building remotely on H26 (ubuntu xenial) in workspace 

[Phoenix_Compile_Compat_wHBase] $ /bin/bash /tmp/jenkins5560133520241160953.sh
core file size  (blocks, -c) 0
data seg size   (kbytes, -d) unlimited
scheduling priority (-e) 0
file size   (blocks, -f) unlimited
pending signals (-i) 386417
max locked memory   (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files  (-n) 6
pipe size(512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority  (-r) 0
stack size  (kbytes, -s) 8192
cpu time   (seconds, -t) unlimited
max user processes  (-u) 10240
virtual memory  (kbytes, -v) unlimited
file locks  (-x) unlimited
core id : 0
core id : 1
core id : 2
core id : 3
core id : 4
core id : 5
physical id : 0
physical id : 1
MemTotal:   98958120 kB
MemFree:11211232 kB
Filesystem  Size  Used Avail Use% Mounted on
udev 48G 0   48G   0% /dev
tmpfs   9.5G  946M  8.6G  10% /run
/dev/sda1   364G  231G  115G  67% /
tmpfs48G  2.3M   48G   1% /dev/shm
tmpfs   5.0M 0  5.0M   0% /run/lock
tmpfs48G 0   48G   0% /sys/fs/cgroup
tmpfs   9.5G 0  9.5G   0% /run/user/910
apache-maven-2.2.1
apache-maven-3.0.4
apache-maven-3.0.5
apache-maven-3.2.1
apache-maven-3.2.5
apache-maven-3.3.3
apache-maven-3.3.9
apache-maven-3.5.0
apache-maven-3.5.2
latest
latest2
latest3


===
Verifying compile level compatibility with HBase 0.98 with Phoenix 
4.x-HBase-0.98
===

Cloning into 'hbase'...
Switched to a new branch '0.98'
Branch 0.98 set up to track remote branch 0.98 from origin.

main:
 [exec] 
~/jenkins-slave/workspace/Phoenix_Compile_Compat_wHBase/hbase/hbase-common 
~/jenkins-slave/workspace/Phoenix_Compile_Compat_wHBase/hbase/hbase-common
 [exec] 
~/jenkins-slave/workspace/Phoenix_Compile_Compat_wHBase/hbase/hbase-common

main:
[mkdir] Created dir: 

 [exec] tar: hadoop-snappy-nativelibs.tar: Cannot open: No such file or 
directory
 [exec] tar: Error is not recoverable: exiting now
 [exec] Result: 2

main:
[mkdir] Created dir: 

 [copy] Copying 20 files to 

[mkdir] Created dir: 

[mkdir] Created dir: 


main:
[mkdir] Created dir: 

 [copy] Copying 17 files to 

[mkdir] Created dir: 


main:
[mkdir] Created dir: 

 [copy] Copying 1 file to 

[mkdir] Created dir: 


HBase pom.xml:

Got HBase version as 0.98.25-SNAPSHOT
Cloning into 'phoenix'...
Switched to a new branch '4.x-HBase-0.98'
Branch 4.x-HBase-0.98 set up to track remote branch 4.x-HBase-0.98 from origin.
ANTLR Parser Generator  Version 3.5.2
Output file 

 does not exist: must build 

PhoenixSQL.g


===
Verifying compile level compatibility with HBase branch-1.3 with Phoenix master