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

2018-12-11 Thread Apache Jenkins Server
See 

--
[...truncated 97.61 KB...]
[WARNING] Tests run: 3500, Failures: 0, Errors: 0, Skipped: 1
[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] Running org.apache.phoenix.end2end.ChangePermissionsIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 35.017 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] Running 
org.apache.phoenix.end2end.ColumnEncodedMutableNonTxStatsCollectorIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.171 s 
- in org.apache.hadoop.hbase.regionserver.wal.WALRecoveryRegionPostOpenIT
[INFO] Running 
org.apache.phoenix.end2end.ColumnEncodedImmutableNonTxStatsCollectorIT
[INFO] Running org.apache.phoenix.end2end.ColumnEncodedMutableTxStatsCollectorIT
[INFO] Running 
org.apache.phoenix.end2end.ColumnEncodedImmutableTxStatsCollectorIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 53.732 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.751 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.566 s 
- in org.apache.phoenix.end2end.CountDistinctCompressionIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
171.179 s - in 
org.apache.phoenix.end2end.ColumnEncodedMutableNonTxStatsCollectorIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
173.977 s - in 
org.apache.phoenix.end2end.ColumnEncodedImmutableNonTxStatsCollectorIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
170.383 s - in org.apache.phoenix.end2end.ColumnEncodedMutableTxStatsCollectorIT
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
171.04 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.IndexExtendedIT
[INFO] Running org.apache.phoenix.end2end.IndexScrutinyToolIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 23.035 s 
- in org.apache.phoenix.end2end.DropSchemaIT
[INFO] Tests run: 13, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 118.324 
s - in org.apache.phoenix.end2end.CsvBulkLoadToolIT
[INFO] Running org.apache.phoenix.end2end.IndexToolForPartialBuildIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 32.199 s 
- in org.apache.phoenix.end2end.IndexToolForPartialBuildIT
[INFO] Running 
org.apache.phoenix.end2end.IndexToolForPartialBuildWithNamespaceEnabledIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 30.931 s 
- in org.apache.phoenix.end2end.IndexToolForPartialBuildWithNamespaceEnabledIT
[INFO] Running org.apache.phoenix.end2end.IndexToolIT
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 189.649 
s - in org.apache.phoenix.end2end.FlappingLocalIndexIT
[INFO] Tests run: 32, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 191.078 
s - in org.apache.phoenix.end2end.IndexExtendedIT
[INFO] Running org.apache.phoenix.end2end.MigrateSystemTablesToSystemNamespaceIT
[INFO] Running org.apache.phoenix.end2end.LocalIndexSplitMergeIT
[INFO] Running 
org.apache.phoenix.end2end.NonColumnEncodedImmutableNonTxStatsCollectorIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 84.701 s 
- in org.apache.phoenix.end2end.LocalIndexSplitMergeIT
[INFO] Tests run: 20, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 497.376 
s - in org.apache.phoenix.end2end.CostBasedDecisionIT
[INFO] Running org.apache.phoenix.end2end.PartialResultServerConfigurationIT
[INFO] Running 
org.apache.phoenix.en

Build failed in Jenkins: Phoenix | Master #2263

2018-12-11 Thread Apache Jenkins Server
See 


Changes:

[tdsilva] PHOENIX-4983: Allow using a connection with a SCN set to write data to

--
[...truncated 114.11 KB...]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.61 s 
- in org.apache.phoenix.trace.PhoenixTableMetricsWriterIT
[INFO] Running org.apache.phoenix.trace.PhoenixTracingEndToEndIT
[WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.002 
s - in org.apache.phoenix.trace.PhoenixTracingEndToEndIT
[INFO] Running org.apache.phoenix.tx.FlappingTransactionIT
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 17.376 s 
- in org.apache.phoenix.tx.FlappingTransactionIT
[INFO] Running org.apache.phoenix.tx.ParameterizedTransactionIT
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 63.057 s 
- in org.apache.phoenix.rpc.UpdateCacheIT
[INFO] Running org.apache.phoenix.tx.TransactionIT
[INFO] Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 661.839 
s - in org.apache.phoenix.end2end.join.SortMergeJoinGlobalIndexIT
[INFO] Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 305.749 
s - in org.apache.phoenix.end2end.join.SubqueryUsingSortMergeJoinIT
[INFO] Running org.apache.phoenix.tx.TxCheckpointIT
[INFO] Running org.apache.phoenix.util.IndexScrutinyIT
[INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 441.822 
s - in org.apache.phoenix.end2end.join.SubqueryIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 30.104 s 
- in org.apache.phoenix.util.IndexScrutinyIT
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 137.056 
s - in org.apache.phoenix.tx.TransactionIT
[INFO] Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 986.937 
s - in org.apache.phoenix.end2end.join.HashJoinLocalIndexIT
[INFO] Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 934.296 
s - in org.apache.phoenix.end2end.join.SortMergeJoinLocalIndexIT
[INFO] Tests run: 40, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 389.422 
s - in org.apache.phoenix.tx.TxCheckpointIT
[INFO] Tests run: 52, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 718.572 
s - in org.apache.phoenix.tx.ParameterizedTransactionIT
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   ConcurrentMutationsIT.testLockUntilMVCCAdvanced:385 Expected data 
table row count to match expected:<1> but was:<0>
[ERROR]   ConcurrentMutationsIT.testRowLockDuringPreBatchMutateWhenIndexed:329 
Expected data table row count to match expected:<1> but was:<0>
[ERROR] Errors: 
[ERROR]   
MutableIndexSplitForwardScanIT.testSplitDuringIndexScan:30->MutableIndexSplitIT.testSplitDuringIndexScan:87->MutableIndexSplitIT.splitDuringScan:152
 » StaleRegionBoundaryCache
[ERROR]   
MutableIndexSplitForwardScanIT.testSplitDuringIndexScan:30->MutableIndexSplitIT.testSplitDuringIndexScan:87->MutableIndexSplitIT.splitDuringScan:152
 » StaleRegionBoundaryCache
[ERROR]   
MutableIndexSplitReverseScanIT.testSplitDuringIndexScan:30->MutableIndexSplitIT.testSplitDuringIndexScan:87->MutableIndexSplitIT.splitDuringScan:152
 » StaleRegionBoundaryCache
[ERROR]   
MutableIndexSplitReverseScanIT.testSplitDuringIndexScan:30->MutableIndexSplitIT.testSplitDuringIndexScan:87->MutableIndexSplitIT.splitDuringScan:152
 » StaleRegionBoundaryCache
[INFO] 
[ERROR] Tests run: 3500, Failures: 2, Errors: 4, Skipped: 10
[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.002 
s - in 
org.apache.hadoop.hbase.regionserver.wal.WALReplayWithIndexWritesAndCompressedWALIT
[INFO] Running org.apache.phoenix.end2end.ChangePermissionsIT
[INFO] Running org.apache.phoenix.end2end.ConnectionUtilIT
[INFO] Running 
org.apache.hadoop.hbase.regionserver.wal.WALRecoveryRegionPostOpenIT
[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: 13.717 s 
- in org.apache.hadoop.hbase.regionserver.wal.WALRecoveryRegionPostOpenIT
[INFO] Running 
org.apache.phoenix.end2end.ColumnEncodedM

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

2018-12-11 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
[tdsilva] PHOENIX-4983: Allow using a connection with a SCN set to write data to



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


phoenix git commit: PHOENIX-4983: Allow using a connection with a SCN set to write data to tables EXCEPT transactional tables or mutable tables with indexes or tables with ROW_TIMESTAMP column.

2018-12-11 Thread tdsilva
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.3 411e44849 -> 44bc4fc22


PHOENIX-4983: Allow using a connection with a SCN set to write data to tables 
EXCEPT transactional tables or mutable tables with indexes or tables with 
ROW_TIMESTAMP column.


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

Branch: refs/heads/4.x-HBase-1.3
Commit: 44bc4fc22a9de76357b77faa35230ec5a7684cc8
Parents: 411e448
Author: s.kadam 
Authored: Mon Dec 10 14:40:17 2018 -0800
Committer: Thomas D'Silva 
Committed: Tue Dec 11 17:04:21 2018 -0800

--
 .../apache/phoenix/end2end/UpsertWithSCNIT.java | 139 +++
 .../apache/phoenix/compile/UpsertCompiler.java  |  23 ++-
 .../phoenix/exception/SQLExceptionCode.java |  13 +-
 .../apache/phoenix/jdbc/PhoenixConnection.java  |   2 +-
 4 files changed, 172 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/44bc4fc2/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
new file mode 100644
index 000..6f231ff
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
@@ -0,0 +1,139 @@
+package org.apache.phoenix.end2end;
+
+import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.exception.SQLExceptionInfo;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+
+public class UpsertWithSCNIT extends ParallelStatsDisabledIT {
+
+@Rule
+public final ExpectedException exception = ExpectedException.none();
+Properties props = null;
+PreparedStatement prep = null;
+String tableName =null;
+
+private void helpTestUpserWithSCNIT(boolean rowColumn, boolean txTable,
+boolean mutable, boolean local, 
boolean global)
+throws SQLException {
+
+tableName = generateUniqueName();
+String indx;
+String createTable = "CREATE TABLE "+tableName+" ("
++ (rowColumn ? "CREATED_DATE DATE NOT NULL, ":"")
++ "METRIC_ID CHAR(15) NOT NULL,METRIC_VALUE VARCHAR(50) 
CONSTRAINT PK PRIMARY KEY("
++ (rowColumn? "CREATED_DATE ROW_TIMESTAMP, ":"") + 
"METRIC_ID)) "
++ (mutable? "IMMUTABLE_ROWS=false":"" )
++ (txTable ? 
"TRANSACTION_PROVIDER='TEPHRA',TRANSACTIONAL=true":"");
+props = new Properties();
+Connection conn = DriverManager.getConnection(getUrl(), props);
+conn.createStatement().execute(createTable);
+
+if(local || global ){
+indx = "CREATE "+ (local? "LOCAL " : "") + "INDEX 
"+tableName+"_idx ON " +
+""+tableName+" (METRIC_VALUE)";
+conn.createStatement().execute(indx);
+}
+
+props.setProperty("CurrentSCN", 
Long.toString(System.currentTimeMillis()));
+conn = DriverManager.getConnection(getUrl(), props);
+conn.setAutoCommit(true);
+String upsert = "UPSERT INTO "+tableName+" (METRIC_ID, METRIC_VALUE) 
VALUES (?,?)";
+prep = conn.prepareStatement(upsert);
+prep.setString(1,"abc");
+prep.setString(2,"This is the first comment!");
+}
+
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4983
+public void testUpsertOnSCNSetTxnTable() throws SQLException {
+
+helpTestUpserWithSCNIT(false, true, false, false, false);
+exception.expect(SQLException.class);
+exception.expectMessage(containsString(String.valueOf(
+SQLExceptionCode
+.CANNOT_SPECIFY_SCN_FOR_TXN_TABLE
+.getErrorCode(;
+prep.executeUpdate();
+}
+
+@Test
+public void testUpsertOnSCNSetMutTableWithoutIdx() throws Exception {
+
+helpTestUpserWithSCNIT(false, false, true, false, false);
+prep.executeUpdate();
+props = new Properties();
+Connection conn = DriverManager.getConnectio

phoenix git commit: PHOENIX-4983: Allow using a connection with a SCN set to write data to tables EXCEPT transactional tables or mutable tables with indexes or tables with ROW_TIMESTAMP column.

2018-12-11 Thread tdsilva
Repository: phoenix
Updated Branches:
  refs/heads/master f0881a137 -> 1c042c25e


PHOENIX-4983: Allow using a connection with a SCN set to write data to tables 
EXCEPT transactional tables or mutable tables with indexes or tables with 
ROW_TIMESTAMP column.


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

Branch: refs/heads/master
Commit: 1c042c25ed833945abe07958b82d5e9fb701ac89
Parents: f0881a1
Author: s.kadam 
Authored: Mon Dec 10 14:40:17 2018 -0800
Committer: Thomas D'Silva 
Committed: Tue Dec 11 17:04:53 2018 -0800

--
 .../apache/phoenix/end2end/UpsertWithSCNIT.java | 139 +++
 .../apache/phoenix/compile/UpsertCompiler.java  |  23 ++-
 .../phoenix/exception/SQLExceptionCode.java |  13 +-
 .../apache/phoenix/jdbc/PhoenixConnection.java  |   2 +-
 4 files changed, 172 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1c042c25/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
new file mode 100644
index 000..6f231ff
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
@@ -0,0 +1,139 @@
+package org.apache.phoenix.end2end;
+
+import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.exception.SQLExceptionInfo;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+
+public class UpsertWithSCNIT extends ParallelStatsDisabledIT {
+
+@Rule
+public final ExpectedException exception = ExpectedException.none();
+Properties props = null;
+PreparedStatement prep = null;
+String tableName =null;
+
+private void helpTestUpserWithSCNIT(boolean rowColumn, boolean txTable,
+boolean mutable, boolean local, 
boolean global)
+throws SQLException {
+
+tableName = generateUniqueName();
+String indx;
+String createTable = "CREATE TABLE "+tableName+" ("
++ (rowColumn ? "CREATED_DATE DATE NOT NULL, ":"")
++ "METRIC_ID CHAR(15) NOT NULL,METRIC_VALUE VARCHAR(50) 
CONSTRAINT PK PRIMARY KEY("
++ (rowColumn? "CREATED_DATE ROW_TIMESTAMP, ":"") + 
"METRIC_ID)) "
++ (mutable? "IMMUTABLE_ROWS=false":"" )
++ (txTable ? 
"TRANSACTION_PROVIDER='TEPHRA',TRANSACTIONAL=true":"");
+props = new Properties();
+Connection conn = DriverManager.getConnection(getUrl(), props);
+conn.createStatement().execute(createTable);
+
+if(local || global ){
+indx = "CREATE "+ (local? "LOCAL " : "") + "INDEX 
"+tableName+"_idx ON " +
+""+tableName+" (METRIC_VALUE)";
+conn.createStatement().execute(indx);
+}
+
+props.setProperty("CurrentSCN", 
Long.toString(System.currentTimeMillis()));
+conn = DriverManager.getConnection(getUrl(), props);
+conn.setAutoCommit(true);
+String upsert = "UPSERT INTO "+tableName+" (METRIC_ID, METRIC_VALUE) 
VALUES (?,?)";
+prep = conn.prepareStatement(upsert);
+prep.setString(1,"abc");
+prep.setString(2,"This is the first comment!");
+}
+
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4983
+public void testUpsertOnSCNSetTxnTable() throws SQLException {
+
+helpTestUpserWithSCNIT(false, true, false, false, false);
+exception.expect(SQLException.class);
+exception.expectMessage(containsString(String.valueOf(
+SQLExceptionCode
+.CANNOT_SPECIFY_SCN_FOR_TXN_TABLE
+.getErrorCode(;
+prep.executeUpdate();
+}
+
+@Test
+public void testUpsertOnSCNSetMutTableWithoutIdx() throws Exception {
+
+helpTestUpserWithSCNIT(false, false, true, false, false);
+prep.executeUpdate();
+props = new Properties();
+Connection conn = DriverManager.getConnection(getUrl(),pro

phoenix git commit: PHOENIX-4983: Allow using a connection with a SCN set to write data to tables EXCEPT transactional tables or mutable tables with indexes or tables with ROW_TIMESTAMP column.

2018-12-11 Thread tdsilva
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.4 e88051a3e -> c634bf743


PHOENIX-4983: Allow using a connection with a SCN set to write data to tables 
EXCEPT transactional tables or mutable tables with indexes or tables with 
ROW_TIMESTAMP column.


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

Branch: refs/heads/4.x-HBase-1.4
Commit: c634bf743632383a5dc369b5a9f08968949c8bfc
Parents: e88051a
Author: s.kadam 
Authored: Mon Dec 10 14:40:17 2018 -0800
Committer: Thomas D'Silva 
Committed: Tue Dec 11 17:04:35 2018 -0800

--
 .../apache/phoenix/end2end/UpsertWithSCNIT.java | 139 +++
 .../apache/phoenix/compile/UpsertCompiler.java  |  23 ++-
 .../phoenix/exception/SQLExceptionCode.java |  13 +-
 .../apache/phoenix/jdbc/PhoenixConnection.java  |   2 +-
 4 files changed, 172 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c634bf74/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
new file mode 100644
index 000..6f231ff
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
@@ -0,0 +1,139 @@
+package org.apache.phoenix.end2end;
+
+import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.exception.SQLExceptionInfo;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+
+public class UpsertWithSCNIT extends ParallelStatsDisabledIT {
+
+@Rule
+public final ExpectedException exception = ExpectedException.none();
+Properties props = null;
+PreparedStatement prep = null;
+String tableName =null;
+
+private void helpTestUpserWithSCNIT(boolean rowColumn, boolean txTable,
+boolean mutable, boolean local, 
boolean global)
+throws SQLException {
+
+tableName = generateUniqueName();
+String indx;
+String createTable = "CREATE TABLE "+tableName+" ("
++ (rowColumn ? "CREATED_DATE DATE NOT NULL, ":"")
++ "METRIC_ID CHAR(15) NOT NULL,METRIC_VALUE VARCHAR(50) 
CONSTRAINT PK PRIMARY KEY("
++ (rowColumn? "CREATED_DATE ROW_TIMESTAMP, ":"") + 
"METRIC_ID)) "
++ (mutable? "IMMUTABLE_ROWS=false":"" )
++ (txTable ? 
"TRANSACTION_PROVIDER='TEPHRA',TRANSACTIONAL=true":"");
+props = new Properties();
+Connection conn = DriverManager.getConnection(getUrl(), props);
+conn.createStatement().execute(createTable);
+
+if(local || global ){
+indx = "CREATE "+ (local? "LOCAL " : "") + "INDEX 
"+tableName+"_idx ON " +
+""+tableName+" (METRIC_VALUE)";
+conn.createStatement().execute(indx);
+}
+
+props.setProperty("CurrentSCN", 
Long.toString(System.currentTimeMillis()));
+conn = DriverManager.getConnection(getUrl(), props);
+conn.setAutoCommit(true);
+String upsert = "UPSERT INTO "+tableName+" (METRIC_ID, METRIC_VALUE) 
VALUES (?,?)";
+prep = conn.prepareStatement(upsert);
+prep.setString(1,"abc");
+prep.setString(2,"This is the first comment!");
+}
+
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4983
+public void testUpsertOnSCNSetTxnTable() throws SQLException {
+
+helpTestUpserWithSCNIT(false, true, false, false, false);
+exception.expect(SQLException.class);
+exception.expectMessage(containsString(String.valueOf(
+SQLExceptionCode
+.CANNOT_SPECIFY_SCN_FOR_TXN_TABLE
+.getErrorCode(;
+prep.executeUpdate();
+}
+
+@Test
+public void testUpsertOnSCNSetMutTableWithoutIdx() throws Exception {
+
+helpTestUpserWithSCNIT(false, false, true, false, false);
+prep.executeUpdate();
+props = new Properties();
+Connection conn = DriverManager.getConnectio

phoenix git commit: PHOENIX-4983: Allow using a connection with a SCN set to write data to tables EXCEPT transactional tables or mutable tables with indexes or tables with ROW_TIMESTAMP column.

2018-12-11 Thread tdsilva
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 40cdb7b87 -> f257f5e02


PHOENIX-4983: Allow using a connection with a SCN set to write data to tables 
EXCEPT transactional tables or mutable tables with indexes or tables with 
ROW_TIMESTAMP column.


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

Branch: refs/heads/4.x-HBase-1.2
Commit: f257f5e02898aecd5a4ae0079f1d63a6549cc6e5
Parents: 40cdb7b
Author: s.kadam 
Authored: Mon Dec 10 14:40:17 2018 -0800
Committer: Thomas D'Silva 
Committed: Tue Dec 11 17:04:07 2018 -0800

--
 .../apache/phoenix/end2end/UpsertWithSCNIT.java | 139 +++
 .../apache/phoenix/compile/UpsertCompiler.java  |  23 ++-
 .../phoenix/exception/SQLExceptionCode.java |  13 +-
 .../apache/phoenix/jdbc/PhoenixConnection.java  |   2 +-
 4 files changed, 172 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f257f5e0/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
new file mode 100644
index 000..6f231ff
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertWithSCNIT.java
@@ -0,0 +1,139 @@
+package org.apache.phoenix.end2end;
+
+import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.exception.SQLExceptionInfo;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+
+public class UpsertWithSCNIT extends ParallelStatsDisabledIT {
+
+@Rule
+public final ExpectedException exception = ExpectedException.none();
+Properties props = null;
+PreparedStatement prep = null;
+String tableName =null;
+
+private void helpTestUpserWithSCNIT(boolean rowColumn, boolean txTable,
+boolean mutable, boolean local, 
boolean global)
+throws SQLException {
+
+tableName = generateUniqueName();
+String indx;
+String createTable = "CREATE TABLE "+tableName+" ("
++ (rowColumn ? "CREATED_DATE DATE NOT NULL, ":"")
++ "METRIC_ID CHAR(15) NOT NULL,METRIC_VALUE VARCHAR(50) 
CONSTRAINT PK PRIMARY KEY("
++ (rowColumn? "CREATED_DATE ROW_TIMESTAMP, ":"") + 
"METRIC_ID)) "
++ (mutable? "IMMUTABLE_ROWS=false":"" )
++ (txTable ? 
"TRANSACTION_PROVIDER='TEPHRA',TRANSACTIONAL=true":"");
+props = new Properties();
+Connection conn = DriverManager.getConnection(getUrl(), props);
+conn.createStatement().execute(createTable);
+
+if(local || global ){
+indx = "CREATE "+ (local? "LOCAL " : "") + "INDEX 
"+tableName+"_idx ON " +
+""+tableName+" (METRIC_VALUE)";
+conn.createStatement().execute(indx);
+}
+
+props.setProperty("CurrentSCN", 
Long.toString(System.currentTimeMillis()));
+conn = DriverManager.getConnection(getUrl(), props);
+conn.setAutoCommit(true);
+String upsert = "UPSERT INTO "+tableName+" (METRIC_ID, METRIC_VALUE) 
VALUES (?,?)";
+prep = conn.prepareStatement(upsert);
+prep.setString(1,"abc");
+prep.setString(2,"This is the first comment!");
+}
+
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4983
+public void testUpsertOnSCNSetTxnTable() throws SQLException {
+
+helpTestUpserWithSCNIT(false, true, false, false, false);
+exception.expect(SQLException.class);
+exception.expectMessage(containsString(String.valueOf(
+SQLExceptionCode
+.CANNOT_SPECIFY_SCN_FOR_TXN_TABLE
+.getErrorCode(;
+prep.executeUpdate();
+}
+
+@Test
+public void testUpsertOnSCNSetMutTableWithoutIdx() throws Exception {
+
+helpTestUpserWithSCNIT(false, false, true, false, false);
+prep.executeUpdate();
+props = new Properties();
+Connection conn = DriverManager.getConnectio

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

2018-12-11 Thread Apache Jenkins Server
See 


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

[Phoenix_Compile_Compat_wHBase] $ /bin/bash /tmp/jenkins846704949549217239.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:40713416 kB
Filesystem  Size  Used Avail Use% Mounted on
udev 48G 0   48G   0% /dev
tmpfs   9.5G  346M  9.2G   4% /run
/dev/sda3   3.6T  241G  3.2T   7% /
tmpfs48G  764K   48G   1% /dev/shm
tmpfs   5.0M 0  5.0M   0% /run/lock
tmpfs48G 0   48G   0% /sys/fs/cgroup
/dev/sda2   473M  146M  304M  33% /boot
/dev/loop1   28M   28M 0 100% /snap/snapcraft/1871
/dev/loop4   88M   88M 0 100% /snap/core/5742
tmpfs   9.5G  4.0K  9.5G   1% /run/user/910
/dev/loop6   52M   52M 0 100% /snap/lxd/9564
/dev/loop5   52M   52M 0 100% /snap/lxd/9600
/dev/loop2   89M   89M 0 100% /snap/core/5897
/dev/loop7   52M   52M 0 100% /snap/lxd/9664
tmpfs   9.5G 0  9.5G   0% /run/user/1000
/dev/loop3   28M   28M 0 100% /snap/snapcraft/2374
/dev/loop8   90M   90M 0 100% /snap/core/6034
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
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