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

2019-08-26 Thread Apache Jenkins Server
4.x-HBase-1.3 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.3

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

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

Changes
[chinmayskulkarni] PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should not modify



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


Build failed in Jenkins: Phoenix-4.x-HBase-1.3 #529

2019-08-26 Thread Apache Jenkins Server
See 


Changes:

[chinmayskulkarni] PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should 
not modify

--
[...truncated 103.62 KB...]
[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
[WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.003 
s - in 
org.apache.hadoop.hbase.regionserver.wal.WALReplayWithIndexWritesAndCompressedWALIT
[INFO] Running org.apache.phoenix.end2end.ConnectionUtilIT
[INFO] Running 
org.apache.hadoop.hbase.regionserver.wal.WALRecoveryRegionPostOpenIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.422 s 
- in org.apache.hadoop.hbase.regionserver.wal.WALRecoveryRegionPostOpenIT
[INFO] Running org.apache.phoenix.end2end.ColumnEncodedMutableTxStatsCollectorIT
[INFO] Running 
org.apache.phoenix.end2end.ColumnEncodedImmutableNonTxStatsCollectorIT
[INFO] Running org.apache.phoenix.end2end.ConcurrentMutationsExtendedIT
[INFO] Running 
org.apache.phoenix.end2end.ColumnEncodedImmutableTxStatsCollectorIT
[INFO] Running 
org.apache.phoenix.end2end.ColumnEncodedMutableNonTxStatsCollectorIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 49.749 s 
- in org.apache.phoenix.end2end.ConnectionUtilIT
[INFO] Running org.apache.phoenix.end2end.ContextClassloaderIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.693 s 
- in org.apache.phoenix.end2end.ContextClassloaderIT
[INFO] Running org.apache.phoenix.end2end.CostBasedDecisionIT
[INFO] Running org.apache.phoenix.end2end.CountDistinctCompressionIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.646 s 
- in org.apache.phoenix.end2end.CountDistinctCompressionIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
187.251 s - in 
org.apache.phoenix.end2end.ColumnEncodedMutableNonTxStatsCollectorIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
190.179 s - in org.apache.phoenix.end2end.ColumnEncodedMutableTxStatsCollectorIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
187.979 s - in 
org.apache.phoenix.end2end.ColumnEncodedImmutableTxStatsCollectorIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
190.795 s - in 
org.apache.phoenix.end2end.ColumnEncodedImmutableNonTxStatsCollectorIT
[INFO] Running org.apache.phoenix.end2end.CsvBulkLoadToolIT
[INFO] Running org.apache.phoenix.end2end.DropSchemaIT
[INFO] Running org.apache.phoenix.end2end.FlappingLocalIndexIT
[INFO] Running org.apache.phoenix.end2end.IndexBuildTimestampIT
[INFO] Running org.apache.phoenix.end2end.IndexExtendedIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 34.684 s 
- in org.apache.phoenix.end2end.DropSchemaIT
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 151.135 
s - in org.apache.phoenix.end2end.CsvBulkLoadToolIT
[INFO] Running org.apache.phoenix.end2end.IndexRebuildTaskIT
[INFO] Tests run: 20, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 98.486 
s - in org.apache.phoenix.end2end.IndexExtendedIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 23.206 s 
- in org.apache.phoenix.end2end.IndexRebuildTaskIT
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 430.449 
s - in org.apache.phoenix.end2end.ConcurrentMutationsExtendedIT
[INFO] Running org.apache.phoenix.end2end.IndexToolForPartialBuildIT
[INFO] Running 
org.apache.phoenix.end2end.IndexToolForPartialBuildWithNamespaceEnabledIT
[INFO] Running org.apache.phoenix.end2end.IndexToolIT
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 190.348 
s - in org.apache.phoenix.end2end.IndexBuildTimestampIT
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 194.711 
s - in org.apache.phoenix.end2end.FlappingLocalIndexIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 21.957 s 
- in org.apache.phoenix.end2end.IndexToolForPartialBuildIT
[INFO] Running org.apache.phoenix.end2end.MigrateSystemTablesToSystemNamespaceIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 42.17 s 
- in org.apache.phoenix.end2end.IndexToolForPartialBuildWithNamespaceEnabledIT
[INFO] Running org.apache.phoenix.end2end.LocalIndexSplitMergeIT
[INFO] Running 

Build failed in Jenkins: Phoenix-4.x-HBase-1.4 #246

2019-08-26 Thread Apache Jenkins Server
See 


Changes:

[chinmayskulkarni] PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should 
not modify

--
[...truncated 513.87 KB...]
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 55.957 
s - in org.apache.phoenix.end2end.RegexpSplitFunctionIT
[INFO] Running org.apache.phoenix.end2end.SequenceIT
[INFO] Tests run: 56, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 28.492 
s - in org.apache.phoenix.end2end.SequenceBulkAllocationIT
[INFO] Running org.apache.phoenix.end2end.SerialIteratorsIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.422 s 
- in org.apache.phoenix.end2end.SerialIteratorsIT
[INFO] Running org.apache.phoenix.end2end.ServerExceptionIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.488 s 
- in org.apache.phoenix.end2end.ServerExceptionIT
[INFO] Running org.apache.phoenix.end2end.SetPropertyOnEncodedTableIT
[INFO] Tests run: 54, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 71.873 
s - in org.apache.phoenix.end2end.SequenceIT
[INFO] Running org.apache.phoenix.end2end.SetPropertyOnNonEncodedTableIT
[INFO] Tests run: 33, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 154.012 
s - in org.apache.phoenix.end2end.RoundFloorCeilFuncIT
[INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 150.228 
s - in org.apache.phoenix.end2end.RowTimestampIT
[INFO] Running org.apache.phoenix.end2end.SignFunctionEnd2EndIT
[INFO] Running org.apache.phoenix.end2end.SkipScanAfterManualSplitIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 15.507 s 
- in org.apache.phoenix.end2end.SignFunctionEnd2EndIT
[INFO] Running org.apache.phoenix.end2end.SkipScanQueryIT
[INFO] Tests run: 48, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 245.147 
s - in org.apache.phoenix.end2end.RowValueConstructorIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 43.825 s 
- in org.apache.phoenix.end2end.SkipScanAfterManualSplitIT
[INFO] Running org.apache.phoenix.end2end.SortOrderIT
[INFO] Tests run: 42, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 393.842 
s - in org.apache.phoenix.end2end.QueryIT
[INFO] Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 71.63 s 
- in org.apache.phoenix.end2end.SkipScanQueryIT
[INFO] Running org.apache.phoenix.end2end.SqrtFunctionEnd2EndIT
[INFO] Running org.apache.phoenix.end2end.SortMergeJoinMoreIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 17.684 s 
- in org.apache.phoenix.end2end.SqrtFunctionEnd2EndIT
[INFO] Running org.apache.phoenix.end2end.StatementHintsIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.475 s 
- in org.apache.phoenix.end2end.StatementHintsIT
[INFO] Running org.apache.phoenix.end2end.StddevIT
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 17.92 s 
- in org.apache.phoenix.end2end.StddevIT
[INFO] Running org.apache.phoenix.end2end.StoreNullsIT
[INFO] Running org.apache.phoenix.end2end.SpooledTmpFileDeleteIT
[INFO] Tests run: 32, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 287.422 
s - in org.apache.phoenix.end2end.SetPropertyOnEncodedTableIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.635 s 
- in org.apache.phoenix.end2end.SpooledTmpFileDeleteIT
[INFO] Running org.apache.phoenix.end2end.StringIT
[INFO] Running org.apache.phoenix.end2end.StoreNullsPropIT
[INFO] Tests run: 32, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 288.005 
s - in org.apache.phoenix.end2end.SetPropertyOnNonEncodedTableIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.411 s 
- in org.apache.phoenix.end2end.StoreNullsPropIT
[INFO] Running org.apache.phoenix.end2end.SumFunctionIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.378 s 
- in org.apache.phoenix.end2end.SumFunctionIT
[INFO] Running org.apache.phoenix.end2end.TenantIdTypeIT
[INFO] Tests run: 56, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 525.338 
s - in org.apache.phoenix.end2end.RangeScanIT
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 134.807 
s - in org.apache.phoenix.end2end.SortMergeJoinMoreIT
[INFO] Running org.apache.phoenix.end2end.ToCharFunctionIT
[INFO] Running org.apache.phoenix.end2end.StringToArrayFunctionIT
[INFO] Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 119.124 
s - in org.apache.phoenix.end2end.StringIT
[INFO] Running org.apache.phoenix.end2end.ToDateFunctionIT
[INFO] Running org.apache.phoenix.end2end.TimezoneOffsetFunctionIT
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.667 
s - in org.apache.phoenix.end2end.ToDateFunctionIT
[INFO] Running org.apache.phoenix.end2end.ToNumberFunctionIT
[INFO] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 s 
- in 

Apache Phoenix - Timeout crawler - Build https://builds.apache.org/job/Phoenix-master/2497/

2019-08-26 Thread Apache Jenkins Server
[...truncated 52 lines...]

Apache-Phoenix | Master | Build Successful

2019-08-26 Thread Apache Jenkins Server
Master branch build status Successful
Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/master

Last Successful Compiled Artifacts https://builds.apache.org/job/Phoenix-master/lastSuccessfulBuild/artifact/

Last Complete Test Report https://builds.apache.org/job/Phoenix-master/lastCompletedBuild/testReport/

Changes
[chinmayskulkarni] PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should not modify



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


[phoenix] branch 4.x-HBase-1.5 updated: PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should not modify HBase metadata if failed

2019-08-26 Thread chinmayskulkarni
This is an automated email from the ASF dual-hosted git repository.

chinmayskulkarni pushed a commit to branch 4.x-HBase-1.5
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.5 by this push:
 new 250bf57  PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should 
not modify HBase metadata if failed
250bf57 is described below

commit 250bf57a1a59676ca674893e144eac3a8800a548
Author: Sandeep Pal 
AuthorDate: Mon Aug 26 14:54:33 2019 -0700

PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should not modify 
HBase metadata if failed

Signed-off-by: Chinmay Kulkarni 
---
 .../org/apache/phoenix/end2end/AlterTableIT.java   | 30 ++
 .../phoenix/query/ConnectionQueryServicesImpl.java |  9 ---
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
index 163be71..ef08fea 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
@@ -851,6 +851,36 @@ public class AlterTableIT extends ParallelStatsDisabledIT {
 conn1.close();
 }
 
+@Test
+public void testAlterTableOnGlobalIndex() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl());
+ HBaseAdmin admin = 
conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
+ Statement stmt = conn.createStatement()) {
+conn.setAutoCommit(false);
+String tableName = generateUniqueName();
+String globalIndexTableName = generateUniqueName();
+
+stmt.execute("CREATE TABLE " + tableName +
+" (ID INTEGER PRIMARY KEY, COL1 VARCHAR(10), COL2 BOOLEAN)");
+
+stmt.execute("CREATE INDEX " + globalIndexTableName + " on " + 
tableName + " (COL2)");
+HTableDescriptor originalDesc = 
admin.getTableDescriptor(Bytes.toBytes(globalIndexTableName));
+
+try {
+stmt.execute("ALTER TABLE " + globalIndexTableName + " ADD 
CF1.AGE INTEGER ");
+conn.commit();
+fail("The alter table did not fail as expected");
+} catch (SQLException e) {
+assertEquals(e.getErrorCode(), 
SQLExceptionCode.CANNOT_MUTATE_TABLE.getErrorCode());
+}
+
+HTableDescriptor finalDesc = 
admin.getTableDescriptor(Bytes.toBytes(globalIndexTableName));
+assertTrue(finalDesc.equals(originalDesc));
+
+// drop the table
+stmt.execute("DROP TABLE " + tableName);
+}
+}
 
 @Test
 public void testAlterStoreNulls() throws SQLException {
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index d5a08bc..fd9092f 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -2042,9 +2042,6 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 // When adding a column to a view, base physical table should 
only be modified when new column families are being added.
 modifyHTable = canViewsAddNewCF && 
!existingColumnFamiliesForBaseTable(table.getPhysicalName()).containsAll(colFamiliesForPColumnsToBeAdded);
 }
-if (modifyHTable) {
-sendHBaseMetaData(tableDescriptors, pollingNeeded);
-}
 
 // Special case for call during drop table to ensure that the 
empty column family exists.
 // In this, case we only include the table header row, as until we 
add schemaBytes and tableBytes
@@ -2052,6 +2049,9 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 // TODO: change to  if (tableMetaData.isEmpty()) once we pass 
through schemaBytes and tableBytes
 // Also, could be used to update property values on ALTER TABLE t 
SET prop=xxx
 if ((tableMetaData.isEmpty()) || (tableMetaData.size() == 1 && 
tableMetaData.get(0).isEmpty())) {
+if (modifyHTable) {
+sendHBaseMetaData(tableDescriptors, pollingNeeded);
+}
 return new MetaDataMutationResult(MutationCode.NO_OP, 
EnvironmentEdgeManager.currentTimeMillis(), table);
 }
 byte[][] rowKeyMetaData = new byte[3][];
@@ -2109,6 +2109,9 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 }
 }
 }
+if (modifyHTable && result.getMutationCode() != 

[phoenix] branch 4.x-HBase-1.4 updated: PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should not modify HBase metadata if failed

2019-08-26 Thread chinmayskulkarni
This is an automated email from the ASF dual-hosted git repository.

chinmayskulkarni pushed a commit to branch 4.x-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push:
 new 034434a  PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should 
not modify HBase metadata if failed
034434a is described below

commit 034434a99e24bc8eea4a42fd3f8c25cbea800ca0
Author: Sandeep Pal 
AuthorDate: Mon Aug 26 14:54:33 2019 -0700

PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should not modify 
HBase metadata if failed

Signed-off-by: Chinmay Kulkarni 
---
 .../org/apache/phoenix/end2end/AlterTableIT.java   | 30 ++
 .../phoenix/query/ConnectionQueryServicesImpl.java |  9 ---
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
index 163be71..ef08fea 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
@@ -851,6 +851,36 @@ public class AlterTableIT extends ParallelStatsDisabledIT {
 conn1.close();
 }
 
+@Test
+public void testAlterTableOnGlobalIndex() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl());
+ HBaseAdmin admin = 
conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
+ Statement stmt = conn.createStatement()) {
+conn.setAutoCommit(false);
+String tableName = generateUniqueName();
+String globalIndexTableName = generateUniqueName();
+
+stmt.execute("CREATE TABLE " + tableName +
+" (ID INTEGER PRIMARY KEY, COL1 VARCHAR(10), COL2 BOOLEAN)");
+
+stmt.execute("CREATE INDEX " + globalIndexTableName + " on " + 
tableName + " (COL2)");
+HTableDescriptor originalDesc = 
admin.getTableDescriptor(Bytes.toBytes(globalIndexTableName));
+
+try {
+stmt.execute("ALTER TABLE " + globalIndexTableName + " ADD 
CF1.AGE INTEGER ");
+conn.commit();
+fail("The alter table did not fail as expected");
+} catch (SQLException e) {
+assertEquals(e.getErrorCode(), 
SQLExceptionCode.CANNOT_MUTATE_TABLE.getErrorCode());
+}
+
+HTableDescriptor finalDesc = 
admin.getTableDescriptor(Bytes.toBytes(globalIndexTableName));
+assertTrue(finalDesc.equals(originalDesc));
+
+// drop the table
+stmt.execute("DROP TABLE " + tableName);
+}
+}
 
 @Test
 public void testAlterStoreNulls() throws SQLException {
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index d5a08bc..fd9092f 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -2042,9 +2042,6 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 // When adding a column to a view, base physical table should 
only be modified when new column families are being added.
 modifyHTable = canViewsAddNewCF && 
!existingColumnFamiliesForBaseTable(table.getPhysicalName()).containsAll(colFamiliesForPColumnsToBeAdded);
 }
-if (modifyHTable) {
-sendHBaseMetaData(tableDescriptors, pollingNeeded);
-}
 
 // Special case for call during drop table to ensure that the 
empty column family exists.
 // In this, case we only include the table header row, as until we 
add schemaBytes and tableBytes
@@ -2052,6 +2049,9 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 // TODO: change to  if (tableMetaData.isEmpty()) once we pass 
through schemaBytes and tableBytes
 // Also, could be used to update property values on ALTER TABLE t 
SET prop=xxx
 if ((tableMetaData.isEmpty()) || (tableMetaData.size() == 1 && 
tableMetaData.get(0).isEmpty())) {
+if (modifyHTable) {
+sendHBaseMetaData(tableDescriptors, pollingNeeded);
+}
 return new MetaDataMutationResult(MutationCode.NO_OP, 
EnvironmentEdgeManager.currentTimeMillis(), table);
 }
 byte[][] rowKeyMetaData = new byte[3][];
@@ -2109,6 +2109,9 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 }
 }
 }
+if (modifyHTable && result.getMutationCode() != 

[phoenix] branch 4.x-HBase-1.3 updated: PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should not modify HBase metadata if failed

2019-08-26 Thread chinmayskulkarni
This is an automated email from the ASF dual-hosted git repository.

chinmayskulkarni pushed a commit to branch 4.x-HBase-1.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.3 by this push:
 new 9298bbb  PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should 
not modify HBase metadata if failed
9298bbb is described below

commit 92988fe20d8aedf031a0ed6219265d737afc
Author: Sandeep Pal 
AuthorDate: Mon Aug 26 14:54:33 2019 -0700

PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should not modify 
HBase metadata if failed

Signed-off-by: Chinmay Kulkarni 
---
 .../org/apache/phoenix/end2end/AlterTableIT.java   | 30 ++
 .../phoenix/query/ConnectionQueryServicesImpl.java |  9 ---
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
index 163be71..ef08fea 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
@@ -851,6 +851,36 @@ public class AlterTableIT extends ParallelStatsDisabledIT {
 conn1.close();
 }
 
+@Test
+public void testAlterTableOnGlobalIndex() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl());
+ HBaseAdmin admin = 
conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
+ Statement stmt = conn.createStatement()) {
+conn.setAutoCommit(false);
+String tableName = generateUniqueName();
+String globalIndexTableName = generateUniqueName();
+
+stmt.execute("CREATE TABLE " + tableName +
+" (ID INTEGER PRIMARY KEY, COL1 VARCHAR(10), COL2 BOOLEAN)");
+
+stmt.execute("CREATE INDEX " + globalIndexTableName + " on " + 
tableName + " (COL2)");
+HTableDescriptor originalDesc = 
admin.getTableDescriptor(Bytes.toBytes(globalIndexTableName));
+
+try {
+stmt.execute("ALTER TABLE " + globalIndexTableName + " ADD 
CF1.AGE INTEGER ");
+conn.commit();
+fail("The alter table did not fail as expected");
+} catch (SQLException e) {
+assertEquals(e.getErrorCode(), 
SQLExceptionCode.CANNOT_MUTATE_TABLE.getErrorCode());
+}
+
+HTableDescriptor finalDesc = 
admin.getTableDescriptor(Bytes.toBytes(globalIndexTableName));
+assertTrue(finalDesc.equals(originalDesc));
+
+// drop the table
+stmt.execute("DROP TABLE " + tableName);
+}
+}
 
 @Test
 public void testAlterStoreNulls() throws SQLException {
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index d5a08bc..fd9092f 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -2042,9 +2042,6 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 // When adding a column to a view, base physical table should 
only be modified when new column families are being added.
 modifyHTable = canViewsAddNewCF && 
!existingColumnFamiliesForBaseTable(table.getPhysicalName()).containsAll(colFamiliesForPColumnsToBeAdded);
 }
-if (modifyHTable) {
-sendHBaseMetaData(tableDescriptors, pollingNeeded);
-}
 
 // Special case for call during drop table to ensure that the 
empty column family exists.
 // In this, case we only include the table header row, as until we 
add schemaBytes and tableBytes
@@ -2052,6 +2049,9 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 // TODO: change to  if (tableMetaData.isEmpty()) once we pass 
through schemaBytes and tableBytes
 // Also, could be used to update property values on ALTER TABLE t 
SET prop=xxx
 if ((tableMetaData.isEmpty()) || (tableMetaData.size() == 1 && 
tableMetaData.get(0).isEmpty())) {
+if (modifyHTable) {
+sendHBaseMetaData(tableDescriptors, pollingNeeded);
+}
 return new MetaDataMutationResult(MutationCode.NO_OP, 
EnvironmentEdgeManager.currentTimeMillis(), table);
 }
 byte[][] rowKeyMetaData = new byte[3][];
@@ -2109,6 +2109,9 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 }
 }
 }
+if (modifyHTable && result.getMutationCode() != 

[phoenix] branch master updated: PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should not modify HBase metadata if failed

2019-08-26 Thread chinmayskulkarni
This is an automated email from the ASF dual-hosted git repository.

chinmayskulkarni pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/master by this push:
 new 197b6e3  PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should 
not modify HBase metadata if failed
197b6e3 is described below

commit 197b6e30c894b657758c5d0cb3c6182d6c8d4723
Author: Sandeep Pal 
AuthorDate: Sat Aug 24 13:45:26 2019 -0700

PHOENIX-4743: ALTER TABLE ADD COLUMN for global index should not modify 
HBase metadata if failed

Signed-off-by: Chinmay Kulkarni 
---
 .../org/apache/phoenix/end2end/AlterTableIT.java   | 32 ++
 .../phoenix/query/ConnectionQueryServicesImpl.java | 10 +--
 2 files changed, 39 insertions(+), 3 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
index 7912c58..c2c02de 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
@@ -17,6 +17,7 @@
  */
 package org.apache.phoenix.end2end;
 
+import static 
org.apache.phoenix.exception.SQLExceptionCode.CANNOT_MUTATE_TABLE;
 import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_FAMILY;
 import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_NAME;
 import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_QUALIFIER;
@@ -51,6 +52,7 @@ import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
 import org.apache.hadoop.hbase.client.TableDescriptor;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.phoenix.exception.PhoenixParserException;
 import org.apache.phoenix.exception.SQLExceptionCode;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
@@ -852,6 +854,36 @@ public class AlterTableIT extends ParallelStatsDisabledIT {
 conn1.close();
 }
 
+@Test
+public void testAlterTableOnGlobalIndex() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl());
+ Statement stmt = conn.createStatement()) {
+conn.setAutoCommit(false);
+Admin admin = 
conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
+String tableName = generateUniqueName();
+String globalIndexTableName = generateUniqueName();
+
+stmt.execute("CREATE TABLE " + tableName +
+" (ID INTEGER PRIMARY KEY, COL1 VARCHAR(10), COL2 BOOLEAN)");
+
+stmt.execute("CREATE INDEX " + globalIndexTableName + " on " + 
tableName + " (COL2)");
+TableDescriptor originalDesc = 
admin.getDescriptor(TableName.valueOf(globalIndexTableName));
+int expectedErrorCode = 0;
+try {
+stmt.execute("ALTER TABLE " + globalIndexTableName + " ADD 
CF1.AGE INTEGER ");
+conn.commit();
+fail("The alter table did not fail as expected");
+} catch (SQLException e) {
+assertEquals(e.getErrorCode(), 
CANNOT_MUTATE_TABLE.getErrorCode());
+}
+
+TableDescriptor finalDesc = 
admin.getDescriptor(TableName.valueOf(globalIndexTableName));
+assertTrue(finalDesc.equals(originalDesc));
+
+// drop the table
+stmt.execute("DROP TABLE " + tableName);
+}
+}
 
 @Test
 public void testAlterStoreNulls() throws SQLException {
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index 4112984..e5c935d 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -2060,9 +2060,6 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 // When adding a column to a view, base physical table should 
only be modified when new column families are being added.
 modifyHTable = canViewsAddNewCF && 
!existingColumnFamiliesForBaseTable(table.getPhysicalName()).containsAll(colFamiliesForPColumnsToBeAdded);
 }
-if (modifyHTable) {
-sendHBaseMetaData(tableDescriptors, pollingNeeded);
-}
 
 // Special case for call during drop table to ensure that the 
empty column family exists.
 // In this, case we only include the table header row, as until we 
add schemaBytes and tableBytes
@@ -2070,6 +2067,9 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 // TODO: change to  if 

svn commit: r1865955 - in /phoenix/site: publish/language/datatypes.html publish/language/functions.html publish/language/index.html publish/team.html source/src/site/markdown/team.md

2019-08-26 Thread chinmayskulkarni
Author: chinmayskulkarni
Date: Mon Aug 26 21:23:49 2019
New Revision: 1865955

URL: http://svn.apache.org/viewvc?rev=1865955=rev
Log:
Update Chinmay Kulkarni's role to PMC

Modified:
phoenix/site/publish/language/datatypes.html
phoenix/site/publish/language/functions.html
phoenix/site/publish/language/index.html
phoenix/site/publish/team.html
phoenix/site/source/src/site/markdown/team.md

Modified: phoenix/site/publish/language/datatypes.html
URL: 
http://svn.apache.org/viewvc/phoenix/site/publish/language/datatypes.html?rev=1865955=1865954=1865955=diff
==
--- phoenix/site/publish/language/datatypes.html (original)
+++ phoenix/site/publish/language/datatypes.html Mon Aug 26 21:23:49 2019
@@ -1,7 +1,7 @@
 
 
 
 

Modified: phoenix/site/publish/language/functions.html
URL: 
http://svn.apache.org/viewvc/phoenix/site/publish/language/functions.html?rev=1865955=1865954=1865955=diff
==
--- phoenix/site/publish/language/functions.html (original)
+++ phoenix/site/publish/language/functions.html Mon Aug 26 21:23:49 2019
@@ -1,7 +1,7 @@
 
 
 
 

Modified: phoenix/site/publish/language/index.html
URL: 
http://svn.apache.org/viewvc/phoenix/site/publish/language/index.html?rev=1865955=1865954=1865955=diff
==
--- phoenix/site/publish/language/index.html (original)
+++ phoenix/site/publish/language/index.html Mon Aug 26 21:23:49 2019
@@ -1,7 +1,7 @@
 
 
 
 

Modified: phoenix/site/publish/team.html
URL: 
http://svn.apache.org/viewvc/phoenix/site/publish/team.html?rev=1865955=1865954=1865955=diff
==
--- phoenix/site/publish/team.html (original)
+++ phoenix/site/publish/team.html Mon Aug 26 21:23:49 2019
@@ -1,7 +1,7 @@
 
 
 
 
@@ -203,179 +203,179 @@
PMC 


+   Chinmay Kulkarni  
+   Salesforce  
+   mailto:chinmayskulka...@apache.org;>chinmayskulka...@apache.org  
+   PMC 
+   
+   
Devaraj Das  
Hortonworks  
mailto:d...@apache.org;>d...@apache.org  
PMC 

-   
+   
Eli Levine  
Salesforce  
mailto:elilev...@apache.org;>elilev...@apache.org  
PMC 

-   
+   
Enis Soztutar  
Hortonworks  
mailto:e...@apache.org;>e...@apache.org  
PMC 

-   
+   
Gabriel Reid  
NGDATA  
mailto:gr...@apache.org;>gr...@apache.org  
PMC 

-   
+   
Geoffrey Jacoby  
Salesforce  
mailto:gjac...@apache.org;>gjac...@apache.org  
PMC 

-   
+   
James Taylor  
Lyft  
mailto:jamestay...@apache.org;>jamestay...@apache.org  
PMC 

-   
+   
Jeffrey Zhong  
Elementum  
mailto:jeffr...@apache.org;>jeffr...@apache.org  
PMC 

-   
+   
Jesse Yates  
Tesla  
mailto:jya...@apache.org;>jya...@apache.org  
PMC 

-   
+   
Josh Elser  
Hortonworks  
mailto:els...@apache.org;>els...@apache.org  
PMC 

-   
+   
Josh Mahonin  
Interset  
mailto:jmaho...@apache.org;>jmaho...@apache.org  
PMC 

-   
+   
Karan Mehta  
Salesforce  
mailto:karanmeht...@apache.org;>karanmeht...@apache.org  
PMC 

-   
+   
Lars Hofhansl  
Salesforce  
mailto:la...@apache.org;>la...@apache.org  
PMC 

-   
+   
Maryann Xue  
Databricks  
mailto:maryann...@apache.org;>maryann...@apache.org  
PMC 

-   
+   
Michael Stack  
Cloudera  
mailto:st...@apache.org;>st...@apache.org  
PMC 

-   
+   
Mujtaba Chohan  
Salesforce  
mailto:mujt...@apache.org;>mujt...@apache.org  
PMC 

-   
+   
Nick Dimiduk  
Icebrg  
mailto:ndimi...@apache.org;>ndimi...@apache.org  
PMC 

-   
+   
Pedro Boado  
Datadog  
mailto:pbo...@apache.org;>pbo...@apache.org  
PMC 

-   
+   
Rajeshbabu Chintaguntla  
Hortonworks  
mailto:rajeshb...@apache.org;>rajeshb...@apache.org  
PMC 

-   
+   
Ramkrishna Vasudevan  
Intel  
mailto:ramkris...@apache.org;>ramkris...@apache.org  
PMC 

-   
+   
Ravi Magham  
Elementum  
mailto:ravimag...@apache.org;>ravimag...@apache.org  
PMC 

-   
+   
Samarth Jain  
Netflix  
mailto:sama...@apache.org;>sama...@apache.org  
PMC 

-   
+   
Sergey Soldatov  
Hortonworks  
mailto:s...@apache.org;>s...@apache.org  
PMC 

-   
+   
Simon Toens  
Salesforce  
mailto:sto...@apache.org;>sto...@apache.org  
PMC 

-   
+   
Steven Noels  
NGDATA  
mailto:stev...@apache.org;>stev...@apache.org  
PMC 

-   
+   
Thomas D’Silva  
Salesforce  
mailto:tdsi...@apache.org;>tdsi...@apache.org  
PMC 

-   
+   
Vincent Poon  
Salesforce  

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

2019-08-26 Thread Apache Jenkins Server
See 




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

2019-08-26 Thread Apache Jenkins Server
4.x-HBase-1.3 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.3

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

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

Changes
[Rajeshbabu Chintaguntla] PHOENIX-5136 Rows with null values inserted by UPSERT .. ON DUPLICATE



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


Build failed in Jenkins: Phoenix-4.x-HBase-1.3 #528

2019-08-26 Thread Apache Jenkins Server
See 


Changes:

[Rajeshbabu Chintaguntla] PHOENIX-5136 Rows with null values inserted by UPSERT 
.. ON DUPLICATE

--
[...truncated 103.07 KB...]
[INFO] Results:
[INFO] 
[WARNING] Tests run: 3683, Failures: 0, Errors: 0, Skipped: 2
[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
[WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.003 
s - in 
org.apache.hadoop.hbase.regionserver.wal.WALReplayWithIndexWritesAndCompressedWALIT
[INFO] Running org.apache.phoenix.end2end.ConnectionUtilIT
[INFO] Running 
org.apache.hadoop.hbase.regionserver.wal.WALRecoveryRegionPostOpenIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.093 s 
- in org.apache.hadoop.hbase.regionserver.wal.WALRecoveryRegionPostOpenIT
[INFO] Running org.apache.phoenix.end2end.ColumnEncodedMutableTxStatsCollectorIT
[INFO] Running org.apache.phoenix.end2end.ConcurrentMutationsExtendedIT
[INFO] Running 
org.apache.phoenix.end2end.ColumnEncodedMutableNonTxStatsCollectorIT
[INFO] Running 
org.apache.phoenix.end2end.ColumnEncodedImmutableNonTxStatsCollectorIT
[INFO] Running 
org.apache.phoenix.end2end.ColumnEncodedImmutableTxStatsCollectorIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 54.36 s 
- in org.apache.phoenix.end2end.ConnectionUtilIT
[INFO] Running org.apache.phoenix.end2end.ContextClassloaderIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.554 s 
- in org.apache.phoenix.end2end.ContextClassloaderIT
[INFO] Running org.apache.phoenix.end2end.CostBasedDecisionIT
[INFO] Running org.apache.phoenix.end2end.CountDistinctCompressionIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.623 s 
- in org.apache.phoenix.end2end.CountDistinctCompressionIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
183.593 s - in org.apache.phoenix.end2end.ColumnEncodedMutableTxStatsCollectorIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
184.46 s - in 
org.apache.phoenix.end2end.ColumnEncodedMutableNonTxStatsCollectorIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
183.309 s - in 
org.apache.phoenix.end2end.ColumnEncodedImmutableNonTxStatsCollectorIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
185.713 s - in 
org.apache.phoenix.end2end.ColumnEncodedImmutableTxStatsCollectorIT
[INFO] Running org.apache.phoenix.end2end.CsvBulkLoadToolIT
[INFO] Running org.apache.phoenix.end2end.DropSchemaIT
[INFO] Running org.apache.phoenix.end2end.FlappingLocalIndexIT
[INFO] Running org.apache.phoenix.end2end.IndexBuildTimestampIT
[INFO] Running org.apache.phoenix.end2end.IndexExtendedIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 35.856 s 
- in org.apache.phoenix.end2end.DropSchemaIT
[INFO] Running org.apache.phoenix.end2end.IndexRebuildTaskIT
[INFO] Tests run: 20, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 100.304 
s - in org.apache.phoenix.end2end.IndexExtendedIT
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 374.852 
s - in org.apache.phoenix.end2end.ConcurrentMutationsExtendedIT
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 146.952 
s - in org.apache.phoenix.end2end.CsvBulkLoadToolIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 21.269 s 
- in org.apache.phoenix.end2end.IndexRebuildTaskIT
[INFO] Running org.apache.phoenix.end2end.IndexToolIT
[INFO] Running 
org.apache.phoenix.end2end.IndexToolForPartialBuildWithNamespaceEnabledIT
[INFO] Running org.apache.phoenix.end2end.IndexToolForPartialBuildIT
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 190.129 
s - in org.apache.phoenix.end2end.IndexBuildTimestampIT
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 195.488 
s - in org.apache.phoenix.end2end.FlappingLocalIndexIT
[INFO] Running org.apache.phoenix.end2end.LocalIndexSplitMergeIT
[INFO] Running org.apache.phoenix.end2end.MigrateSystemTablesToSystemNamespaceIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 22.049 s 
- in 

Jenkins build is back to normal : Phoenix-4.x-HBase-1.5 #122

2019-08-26 Thread Apache Jenkins Server
See 




Build failed in Jenkins: Phoenix | Master #2495

2019-08-26 Thread Apache Jenkins Server
See 


Changes:

[Rajeshbabu Chintaguntla] PHOENIX-5136 Rows with null values inserted by UPSERT 
.. ON DUPLICATE

--
[...truncated 1.51 MB...]
[INFO] Running org.apache.phoenix.end2end.index.ChildViewsUseParentViewIndexIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.881 s 
- in org.apache.phoenix.end2end.index.ChildViewsUseParentViewIndexIT
[INFO] Running org.apache.phoenix.end2end.index.GlobalImmutableTxIndexIT
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 183.754 
s - in org.apache.phoenix.end2end.UpsertSelectAutoCommitIT
[INFO] Running org.apache.phoenix.end2end.index.GlobalIndexOptimizationIT
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 43.541 s 
- in org.apache.phoenix.end2end.index.GlobalIndexOptimizationIT
[INFO] Tests run: 50, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 140.641 
s - in org.apache.phoenix.end2end.VariableLengthPKIT
[INFO] Tests run: 35, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 297.709 
s - in org.apache.phoenix.end2end.UngroupedIT
[INFO] Running org.apache.phoenix.end2end.index.GlobalMutableNonTxIndexIT
[INFO] Running 
org.apache.phoenix.end2end.index.GlobalMutableNonTxIndexWithLazyPostBatchWriteIT
[INFO] Running org.apache.phoenix.end2end.index.GlobalMutableTxIndexIT
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 217.353 
s - in org.apache.phoenix.end2end.index.DropColumnIT
[INFO] Running org.apache.phoenix.end2end.index.IndexMaintenanceIT
[INFO] Tests run: 52, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 318.32 
s - in org.apache.phoenix.end2end.UpsertSelectIT
[INFO] Tests run: 38, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 226.251 
s - in org.apache.phoenix.end2end.index.GlobalImmutableNonTxIndexIT
[INFO] Running org.apache.phoenix.end2end.index.IndexMetadataIT
[INFO] Running org.apache.phoenix.end2end.index.IndexUsageIT
[INFO] Tests run: 14, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 120.76 
s - in org.apache.phoenix.end2end.index.IndexMaintenanceIT
[INFO] Tests run: 57, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 335.36 
s - in org.apache.phoenix.end2end.index.GlobalImmutableTxIndexIT
[INFO] Running org.apache.phoenix.end2end.index.IndexWithTableSchemaChangeIT
[INFO] Tests run: 21, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 165.008 
s - in org.apache.phoenix.end2end.index.IndexMetadataIT
[INFO] Running org.apache.phoenix.end2end.index.InvalidIndexStateClientSideIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.703 s 
- in org.apache.phoenix.end2end.index.InvalidIndexStateClientSideIT
[INFO] Running org.apache.phoenix.end2end.index.LocalImmutableTxIndexIT
[INFO] Running org.apache.phoenix.end2end.index.LocalImmutableNonTxIndexIT
[INFO] Tests run: 57, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 327.171 
s - in org.apache.phoenix.end2end.index.GlobalMutableTxIndexIT
[INFO] Running org.apache.phoenix.end2end.index.LocalMutableNonTxIndexIT
[INFO] Tests run: 39, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 298.152 
s - in org.apache.phoenix.end2end.index.IndexUsageIT
[INFO] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 208.361 
s - in org.apache.phoenix.end2end.index.IndexWithTableSchemaChangeIT
[INFO] Tests run: 76, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 437.389 
s - in org.apache.phoenix.end2end.index.GlobalMutableNonTxIndexIT
[INFO] Tests run: 76, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 428.872 
s - in 
org.apache.phoenix.end2end.index.GlobalMutableNonTxIndexWithLazyPostBatchWriteIT
[INFO] Running org.apache.phoenix.end2end.index.LocalMutableTxIndexIT
[INFO] Running org.apache.phoenix.end2end.index.MutableIndexIT
[INFO] Running org.apache.phoenix.end2end.index.MutableIndexSplitForwardScanIT
[INFO] Running org.apache.phoenix.end2end.index.MutableIndexSplitReverseScanIT
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 83.275 s 
- in org.apache.phoenix.end2end.index.MutableIndexSplitForwardScanIT
[INFO] Running org.apache.phoenix.end2end.index.SaltedIndexIT
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 82.616 s 
- in org.apache.phoenix.end2end.index.MutableIndexSplitReverseScanIT
[INFO] Running org.apache.phoenix.end2end.index.txn.MutableRollbackIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 21.096 s 
- in org.apache.phoenix.end2end.index.SaltedIndexIT
[INFO] Running org.apache.phoenix.end2end.index.txn.RollbackIT
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 128.236 
s - in org.apache.phoenix.end2end.index.txn.MutableRollbackIT
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 117.801 
s - in org.apache.phoenix.end2end.index.txn.RollbackIT
[INFO] Tests run: 38, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 486.822 

[phoenix] branch 4.x-HBase-1.3 updated: PHOENIX-5136 Rows with null values inserted by UPSERT .. ON DUPLICATE KEY UPDATE are included in query results when they shouldn't be(Miles Spielberg)

2019-08-26 Thread rajeshbabu
This is an automated email from the ASF dual-hosted git repository.

rajeshbabu pushed a commit to branch 4.x-HBase-1.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.3 by this push:
 new 075d60f  PHOENIX-5136 Rows with null values inserted by UPSERT .. ON 
DUPLICATE KEY UPDATE are included in query results when they shouldn't be(Miles 
Spielberg)
075d60f is described below

commit 075d60f48898394f2d123d16d951a791fbfa28f4
Author: Rajeshbabu Chintaguntla 
AuthorDate: Mon Aug 26 22:06:22 2019 +0530

PHOENIX-5136 Rows with null values inserted by UPSERT .. ON DUPLICATE KEY 
UPDATE are included in query results when they shouldn't be(Miles Spielberg)
---
 .../apache/phoenix/end2end/OnDuplicateKeyIT.java   |  34 +++
 .../apache/phoenix/expression/AndExpression.java   |   2 +-
 .../apache/phoenix/expression/AndOrExpression.java |  25 +-
 .../phoenix/filter/BooleanExpressionFilter.java|   5 +-
 .../phoenix/expression/AndExpressionTest.java  | 297 +
 .../phoenix/expression/OrExpressionTest.java   | 293 
 6 files changed, 648 insertions(+), 8 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
index f1ee0e7..4782e57 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
@@ -580,6 +580,40 @@ public class OnDuplicateKeyIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test
+public void 
testRowsCreatedViaUpsertOnDuplicateKeyShouldNotBeReturnedInQueryIfNotMatched() 
throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String tableName = generateUniqueName();
+String ddl = "create table " + tableName + "(pk varchar primary key, 
counter1 bigint, counter2 smallint)";
+conn.createStatement().execute(ddl);
+createIndex(conn, tableName);
+// The data has to be specifically starting with null for the first 
counter to fail the test. If you reverse the values, the test passes.
+String dml1 = "UPSERT INTO " + tableName + " VALUES('a',NULL,2) ON 
DUPLICATE KEY UPDATE " +
+"counter1 = CASE WHEN (counter1 IS NULL) THEN NULL ELSE 
counter1 END, " +
+"counter2 = CASE WHEN (counter1 IS NULL) THEN 2 ELSE counter2 
END";
+conn.createStatement().execute(dml1);
+conn.commit();
+
+String dml2 = "UPSERT INTO " + tableName + " VALUES('b',1,2) ON 
DUPLICATE KEY UPDATE " +
+"counter1 = CASE WHEN (counter1 IS NULL) THEN 1 ELSE counter1 
END, " +
+"counter2 = CASE WHEN (counter1 IS NULL) THEN 2 ELSE counter2 
END";
+conn.createStatement().execute(dml2);
+conn.commit();
+
+// Using this statement causes the test to pass
+//ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " 
+ tableName + " WHERE counter2 = 2 AND counter1 = 1");
+// This statement should be equivalent to the one above, but it 
selects both rows.
+ResultSet rs = conn.createStatement().executeQuery("SELECT pk, 
counter1, counter2 FROM " + tableName + " WHERE counter2 = 2 AND (counter1 = 1 
OR counter1 = 1)");
+assertTrue(rs.next());
+assertEquals("b",rs.getString(1));
+assertEquals(1,rs.getLong(2));
+assertEquals(2,rs.getLong(3));
+assertFalse(rs.next());
+
+conn.close();
+}
+
 
 }
 
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
index 70e94ca..2aa1827 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
@@ -80,7 +80,7 @@ public class AndExpression extends AndOrExpression {
 
 @Override
 protected boolean isStopValue(Boolean value) {
-return !Boolean.TRUE.equals(value);
+return Boolean.FALSE.equals(value);
 }
 
 @Override
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
index ea8c375..07b07a2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.schema.types.PBoolean;
 import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
-
+import org.apache.phoenix.util.ByteUtil;
 
 /**
  * 

[phoenix] branch 4.x-HBase-1.4 updated: PHOENIX-5136 Rows with null values inserted by UPSERT .. ON DUPLICATE KEY UPDATE are included in query results when they shouldn't be(Miles Spielberg)

2019-08-26 Thread rajeshbabu
This is an automated email from the ASF dual-hosted git repository.

rajeshbabu pushed a commit to branch 4.x-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push:
 new d50991e  PHOENIX-5136 Rows with null values inserted by UPSERT .. ON 
DUPLICATE KEY UPDATE are included in query results when they shouldn't be(Miles 
Spielberg)
d50991e is described below

commit d50991ec3606cadbd73e7c3c1c65a87ef7821cd4
Author: Rajeshbabu Chintaguntla 
AuthorDate: Mon Aug 26 22:02:56 2019 +0530

PHOENIX-5136 Rows with null values inserted by UPSERT .. ON DUPLICATE KEY 
UPDATE are included in query results when they shouldn't be(Miles Spielberg)
---
 .../apache/phoenix/end2end/OnDuplicateKeyIT.java   |  34 +++
 .../apache/phoenix/expression/AndExpression.java   |   2 +-
 .../apache/phoenix/expression/AndOrExpression.java |  25 +-
 .../phoenix/filter/BooleanExpressionFilter.java|   5 +-
 .../phoenix/expression/AndExpressionTest.java  | 297 +
 .../phoenix/expression/OrExpressionTest.java   | 293 
 6 files changed, 648 insertions(+), 8 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
index f1ee0e7..4782e57 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
@@ -580,6 +580,40 @@ public class OnDuplicateKeyIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test
+public void 
testRowsCreatedViaUpsertOnDuplicateKeyShouldNotBeReturnedInQueryIfNotMatched() 
throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String tableName = generateUniqueName();
+String ddl = "create table " + tableName + "(pk varchar primary key, 
counter1 bigint, counter2 smallint)";
+conn.createStatement().execute(ddl);
+createIndex(conn, tableName);
+// The data has to be specifically starting with null for the first 
counter to fail the test. If you reverse the values, the test passes.
+String dml1 = "UPSERT INTO " + tableName + " VALUES('a',NULL,2) ON 
DUPLICATE KEY UPDATE " +
+"counter1 = CASE WHEN (counter1 IS NULL) THEN NULL ELSE 
counter1 END, " +
+"counter2 = CASE WHEN (counter1 IS NULL) THEN 2 ELSE counter2 
END";
+conn.createStatement().execute(dml1);
+conn.commit();
+
+String dml2 = "UPSERT INTO " + tableName + " VALUES('b',1,2) ON 
DUPLICATE KEY UPDATE " +
+"counter1 = CASE WHEN (counter1 IS NULL) THEN 1 ELSE counter1 
END, " +
+"counter2 = CASE WHEN (counter1 IS NULL) THEN 2 ELSE counter2 
END";
+conn.createStatement().execute(dml2);
+conn.commit();
+
+// Using this statement causes the test to pass
+//ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " 
+ tableName + " WHERE counter2 = 2 AND counter1 = 1");
+// This statement should be equivalent to the one above, but it 
selects both rows.
+ResultSet rs = conn.createStatement().executeQuery("SELECT pk, 
counter1, counter2 FROM " + tableName + " WHERE counter2 = 2 AND (counter1 = 1 
OR counter1 = 1)");
+assertTrue(rs.next());
+assertEquals("b",rs.getString(1));
+assertEquals(1,rs.getLong(2));
+assertEquals(2,rs.getLong(3));
+assertFalse(rs.next());
+
+conn.close();
+}
+
 
 }
 
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
index 70e94ca..2aa1827 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
@@ -80,7 +80,7 @@ public class AndExpression extends AndOrExpression {
 
 @Override
 protected boolean isStopValue(Boolean value) {
-return !Boolean.TRUE.equals(value);
+return Boolean.FALSE.equals(value);
 }
 
 @Override
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
index ea8c375..07b07a2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.schema.types.PBoolean;
 import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
-
+import org.apache.phoenix.util.ByteUtil;
 
 /**
  * 

[phoenix] branch 4.x-HBase-1.5 updated: PHOENIX-5136 Rows with null values inserted by UPSERT .. ON DUPLICATE KEY UPDATE are included in query results when they shouldn't be(Miles Spielberg)

2019-08-26 Thread rajeshbabu
This is an automated email from the ASF dual-hosted git repository.

rajeshbabu pushed a commit to branch 4.x-HBase-1.5
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.5 by this push:
 new a7bddf5  PHOENIX-5136 Rows with null values inserted by UPSERT .. ON 
DUPLICATE KEY UPDATE are included in query results when they shouldn't be(Miles 
Spielberg)
a7bddf5 is described below

commit a7bddf530ab53ed41ff5263a86f5e9212628612d
Author: Rajeshbabu Chintaguntla 
AuthorDate: Mon Aug 26 22:00:56 2019 +0530

PHOENIX-5136 Rows with null values inserted by UPSERT .. ON DUPLICATE KEY 
UPDATE are included in query results when they shouldn't be(Miles Spielberg)
---
 .../apache/phoenix/end2end/OnDuplicateKeyIT.java   |  34 +++
 .../apache/phoenix/expression/AndExpression.java   |   2 +-
 .../apache/phoenix/expression/AndOrExpression.java |  25 +-
 .../phoenix/filter/BooleanExpressionFilter.java|   5 +-
 .../phoenix/expression/AndExpressionTest.java  | 297 +
 .../phoenix/expression/OrExpressionTest.java   | 293 
 6 files changed, 648 insertions(+), 8 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
index f1ee0e7..4782e57 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
@@ -580,6 +580,40 @@ public class OnDuplicateKeyIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test
+public void 
testRowsCreatedViaUpsertOnDuplicateKeyShouldNotBeReturnedInQueryIfNotMatched() 
throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String tableName = generateUniqueName();
+String ddl = "create table " + tableName + "(pk varchar primary key, 
counter1 bigint, counter2 smallint)";
+conn.createStatement().execute(ddl);
+createIndex(conn, tableName);
+// The data has to be specifically starting with null for the first 
counter to fail the test. If you reverse the values, the test passes.
+String dml1 = "UPSERT INTO " + tableName + " VALUES('a',NULL,2) ON 
DUPLICATE KEY UPDATE " +
+"counter1 = CASE WHEN (counter1 IS NULL) THEN NULL ELSE 
counter1 END, " +
+"counter2 = CASE WHEN (counter1 IS NULL) THEN 2 ELSE counter2 
END";
+conn.createStatement().execute(dml1);
+conn.commit();
+
+String dml2 = "UPSERT INTO " + tableName + " VALUES('b',1,2) ON 
DUPLICATE KEY UPDATE " +
+"counter1 = CASE WHEN (counter1 IS NULL) THEN 1 ELSE counter1 
END, " +
+"counter2 = CASE WHEN (counter1 IS NULL) THEN 2 ELSE counter2 
END";
+conn.createStatement().execute(dml2);
+conn.commit();
+
+// Using this statement causes the test to pass
+//ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " 
+ tableName + " WHERE counter2 = 2 AND counter1 = 1");
+// This statement should be equivalent to the one above, but it 
selects both rows.
+ResultSet rs = conn.createStatement().executeQuery("SELECT pk, 
counter1, counter2 FROM " + tableName + " WHERE counter2 = 2 AND (counter1 = 1 
OR counter1 = 1)");
+assertTrue(rs.next());
+assertEquals("b",rs.getString(1));
+assertEquals(1,rs.getLong(2));
+assertEquals(2,rs.getLong(3));
+assertFalse(rs.next());
+
+conn.close();
+}
+
 
 }
 
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
index 70e94ca..2aa1827 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
@@ -80,7 +80,7 @@ public class AndExpression extends AndOrExpression {
 
 @Override
 protected boolean isStopValue(Boolean value) {
-return !Boolean.TRUE.equals(value);
+return Boolean.FALSE.equals(value);
 }
 
 @Override
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
index ea8c375..07b07a2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.schema.types.PBoolean;
 import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
-
+import org.apache.phoenix.util.ByteUtil;
 
 /**
  * 

[phoenix] branch master updated: PHOENIX-5136 Rows with null values inserted by UPSERT .. ON DUPLICATE KEY UPDATE are included in query results when they shouldn't be(Miles Spielberg)-addendum

2019-08-26 Thread rajeshbabu
This is an automated email from the ASF dual-hosted git repository.

rajeshbabu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/master by this push:
 new 43310a6  PHOENIX-5136 Rows with null values inserted by UPSERT .. ON 
DUPLICATE KEY UPDATE are included in query results when they shouldn't be(Miles 
Spielberg)-addendum
43310a6 is described below

commit 43310a6dc69433d3df772e17d48fe4d8821d40ac
Author: Rajeshbabu Chintaguntla 
AuthorDate: Mon Aug 26 21:59:02 2019 +0530

PHOENIX-5136 Rows with null values inserted by UPSERT .. ON DUPLICATE KEY 
UPDATE are included in query results when they shouldn't be(Miles 
Spielberg)-addendum
---
 .../phoenix/expression/AndExpressionTest.java  | 297 +
 .../phoenix/expression/OrExpressionTest.java   | 293 
 2 files changed, 590 insertions(+)

diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/expression/AndExpressionTest.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/expression/AndExpressionTest.java
new file mode 100644
index 000..a8f1529
--- /dev/null
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/expression/AndExpressionTest.java
@@ -0,0 +1,297 @@
+package org.apache.phoenix.expression;
+
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.phoenix.query.QueryConstants;
+import org.apache.phoenix.schema.PBaseColumn;
+import org.apache.phoenix.schema.PColumn;
+import org.apache.phoenix.schema.PName;
+import org.apache.phoenix.schema.PNameFactory;
+import org.apache.phoenix.schema.SortOrder;
+import org.apache.phoenix.schema.tuple.MultiKeyValueTuple;
+import org.apache.phoenix.schema.types.PBoolean;
+import org.apache.phoenix.schema.types.PDataType;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class AndExpressionTest {
+
+private AndExpression createAnd(Expression lhs, Expression rhs) {
+return new AndExpression(Arrays.asList(lhs, rhs));
+}
+
+private AndExpression createAnd(Boolean x, Boolean y) {
+return createAnd(LiteralExpression.newConstant(x), 
LiteralExpression.newConstant(y));
+}
+
+private void testImmediateSingle(Boolean expected, Boolean lhs, Boolean 
rhs) {
+AndExpression and = createAnd(lhs, rhs);
+ImmutableBytesWritable out = new ImmutableBytesWritable();
+MultiKeyValueTuple tuple = new MultiKeyValueTuple();
+boolean success = and.evaluate(tuple, out);
+assertTrue(success);
+assertEquals(expected, PBoolean.INSTANCE.toObject(out));
+}
+
+// Evaluating AND when values of both sides are known should immediately 
succeed
+// and return the same result regardless of order.
+private void testImmediate(Boolean expected, Boolean a, Boolean b) {
+testImmediateSingle(expected, a, b);
+testImmediateSingle(expected, b, a);
+}
+
+private PColumn pcolumn(final String name) {
+return new PBaseColumn() {
+@Override public PName getName() {
+return PNameFactory.newName(name);
+}
+
+@Override public PDataType getDataType() {
+return PBoolean.INSTANCE;
+}
+
+@Override public PName getFamilyName() {
+return 
PNameFactory.newName(QueryConstants.DEFAULT_COLUMN_FAMILY);
+}
+
+@Override public int getPosition() {
+return 0;
+}
+
+@Override public Integer getArraySize() {
+return null;
+}
+
+@Override public byte[] getViewConstant() {
+return new byte[0];
+}
+
+@Override public boolean isViewReferenced() {
+return false;
+}
+
+@Override public String getExpressionStr() {
+return null;
+}
+
+@Override public boolean isRowTimestamp() {
+return false;
+}
+
+@Override public boolean isDynamic() {
+return false;
+}
+
+@Override public byte[] getColumnQualifierBytes() {
+return null;
+}
+
+@Override public long getTimestamp() {
+return 0;
+}
+
+@Override public boolean isDerived() {
+return false;
+}
+
+@Override public boolean isExcluded() {
+return false;
+}
+
+@Override public SortOrder getSortOrder() {
+return null;
+  

[phoenix] branch master updated: PHOENIX-5136 Rows with null values inserted by UPSERT .. ON DUPLICATE KEY UPDATE are included in query results when they shouldn't be(Miles Spielberg)

2019-08-26 Thread rajeshbabu
This is an automated email from the ASF dual-hosted git repository.

rajeshbabu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/master by this push:
 new f4579a5  PHOENIX-5136 Rows with null values inserted by UPSERT .. ON 
DUPLICATE KEY UPDATE are included in query results when they shouldn't be(Miles 
Spielberg)
f4579a5 is described below

commit f4579a52a950a880368a2ec9f8cecbd3c67cbae9
Author: Rajeshbabu Chintaguntla 
AuthorDate: Mon Aug 26 21:53:06 2019 +0530

PHOENIX-5136 Rows with null values inserted by UPSERT .. ON DUPLICATE KEY 
UPDATE are included in query results when they shouldn't be(Miles Spielberg)
---
 .../apache/phoenix/end2end/OnDuplicateKeyIT.java   | 34 ++
 .../apache/phoenix/expression/AndExpression.java   |  2 +-
 .../apache/phoenix/expression/AndOrExpression.java | 25 
 .../phoenix/filter/BooleanExpressionFilter.java|  5 +++-
 4 files changed, 58 insertions(+), 8 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
index f1ee0e7..4782e57 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
@@ -580,6 +580,40 @@ public class OnDuplicateKeyIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test
+public void 
testRowsCreatedViaUpsertOnDuplicateKeyShouldNotBeReturnedInQueryIfNotMatched() 
throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String tableName = generateUniqueName();
+String ddl = "create table " + tableName + "(pk varchar primary key, 
counter1 bigint, counter2 smallint)";
+conn.createStatement().execute(ddl);
+createIndex(conn, tableName);
+// The data has to be specifically starting with null for the first 
counter to fail the test. If you reverse the values, the test passes.
+String dml1 = "UPSERT INTO " + tableName + " VALUES('a',NULL,2) ON 
DUPLICATE KEY UPDATE " +
+"counter1 = CASE WHEN (counter1 IS NULL) THEN NULL ELSE 
counter1 END, " +
+"counter2 = CASE WHEN (counter1 IS NULL) THEN 2 ELSE counter2 
END";
+conn.createStatement().execute(dml1);
+conn.commit();
+
+String dml2 = "UPSERT INTO " + tableName + " VALUES('b',1,2) ON 
DUPLICATE KEY UPDATE " +
+"counter1 = CASE WHEN (counter1 IS NULL) THEN 1 ELSE counter1 
END, " +
+"counter2 = CASE WHEN (counter1 IS NULL) THEN 2 ELSE counter2 
END";
+conn.createStatement().execute(dml2);
+conn.commit();
+
+// Using this statement causes the test to pass
+//ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " 
+ tableName + " WHERE counter2 = 2 AND counter1 = 1");
+// This statement should be equivalent to the one above, but it 
selects both rows.
+ResultSet rs = conn.createStatement().executeQuery("SELECT pk, 
counter1, counter2 FROM " + tableName + " WHERE counter2 = 2 AND (counter1 = 1 
OR counter1 = 1)");
+assertTrue(rs.next());
+assertEquals("b",rs.getString(1));
+assertEquals(1,rs.getLong(2));
+assertEquals(2,rs.getLong(3));
+assertFalse(rs.next());
+
+conn.close();
+}
+
 
 }
 
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
index 70e94ca..2aa1827 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndExpression.java
@@ -80,7 +80,7 @@ public class AndExpression extends AndOrExpression {
 
 @Override
 protected boolean isStopValue(Boolean value) {
-return !Boolean.TRUE.equals(value);
+return Boolean.FALSE.equals(value);
 }
 
 @Override
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
index ea8c375..07b07a2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/AndOrExpression.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.schema.types.PBoolean;
 import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
-
+import org.apache.phoenix.util.ByteUtil;
 
 /**
  * 
@@ -36,6 +36,8 @@ import org.apache.phoenix.schema.tuple.Tuple;
 public abstract class AndOrExpression extends BaseCompoundExpression {
 // 

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

2019-08-26 Thread Apache Jenkins Server
See 


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

[Phoenix_Compile_Compat_wHBase] $ /bin/bash /tmp/jenkins5051072422099803733.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) 386431
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:   98963744 kB
MemFree: 3045556 kB
Filesystem  Size  Used Avail Use% Mounted on
udev 48G 0   48G   0% /dev
tmpfs   9.5G  978M  8.5G  11% /run
/dev/sda3   3.6T  607G  2.9T  18% /
tmpfs48G  2.1M   48G   1% /dev/shm
tmpfs   5.0M 0  5.0M   0% /run/lock
tmpfs48G 0   48G   0% /sys/fs/cgroup
/dev/sda2   473M  238M  211M  54% /boot
tmpfs   9.5G  4.0K  9.5G   1% /run/user/910
tmpfs   9.5G 0  9.5G   0% /run/user/1000
/dev/loop8   89M   89M 0 100% /snap/core/7270
/dev/loop11  58M   58M 0 100% /snap/snapcraft/3252
/dev/loop4   89M   89M 0 100% /snap/core/7396
/dev/loop2   58M   58M 0 100% /snap/snapcraft/3308
/dev/loop1   55M   55M 0 100% /snap/lxd/11684
/dev/loop9   55M   55M 0 100% /snap/lxd/11727
apache-maven-2.2.1
apache-maven-3.0.4
apache-maven-3.0.5
apache-maven-3.1.1
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
apache-maven-3.5.4
apache-maven-3.6.0
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.
[ERROR] Plugin org.codehaus.mojo:findbugs-maven-plugin:2.5.2 or one of its 
dependencies could not be resolved: Failed to read artifact descriptor for 
org.codehaus.mojo:findbugs-maven-plugin:jar:2.5.2: Could not transfer artifact 
org.codehaus.mojo:findbugs-maven-plugin:pom:2.5.2 from/to central 
(https://repo.maven.apache.org/maven2): Received fatal alert: protocol_version 
-> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Build step 'Execute shell' marked build as failure