phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject phoenix git commit: PHOENIX-4716 ParameterizedTransactionIT is failing in 0.98 branch
Date Sat, 28 Apr 2018 01:37:05 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.3 59d704e4d -> c08d8e6b7


PHOENIX-4716 ParameterizedTransactionIT is failing in 0.98 branch


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

Branch: refs/heads/4.x-HBase-1.3
Commit: c08d8e6b74d8ee2a5006e05296e301587b3900de
Parents: 59d704e
Author: James Taylor <jtaylor@salesforce.com>
Authored: Fri Apr 27 18:25:56 2018 -0700
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Fri Apr 27 18:36:56 2018 -0700

----------------------------------------------------------------------
 .../phoenix/tx/ParameterizedTransactionIT.java  | 37 +++++++++++---------
 1 file changed, 20 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c08d8e6b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index ce01e2b..580f055 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -71,12 +71,15 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
     private final String tableDDLOptions;
 
     public ParameterizedTransactionIT(boolean mutable, boolean columnEncoded) {
-        StringBuilder optionBuilder = new StringBuilder("TRANSACTIONAL=true");
+        StringBuilder optionBuilder = new StringBuilder();
         if (!columnEncoded) {
-            optionBuilder.append(",COLUMN_ENCODED_BYTES=0");
+            optionBuilder.append("COLUMN_ENCODED_BYTES=0");
         }
         if (!mutable) {
-            optionBuilder.append(",IMMUTABLE_ROWS=true");
+            if (optionBuilder.length() > 0) {
+                optionBuilder.append(",");
+            }
+            optionBuilder.append("IMMUTABLE_ROWS=true");
             if (!columnEncoded) {
                 optionBuilder.append(",IMMUTABLE_STORAGE_SCHEME="+PTableImpl.ImmutableStorageScheme.ONE_CELL_PER_COLUMN);
             }
@@ -97,7 +100,7 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
         String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
         String selectSql = "SELECT * FROM "+ fullTableName;
         try (Connection conn = DriverManager.getConnection(getUrl())) {
-            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions);
+            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true");
             conn.setAutoCommit(false);
             ResultSet rs = conn.createStatement().executeQuery(selectSql);
             assertFalse(rs.next());
@@ -132,7 +135,7 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
         String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
         String selectSql = "SELECT * FROM "+fullTableName;
         try (Connection conn = DriverManager.getConnection(getUrl())) {
-            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions);
+            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true");
             conn.setAutoCommit(false);
             ResultSet rs = conn.createStatement().executeQuery(selectSql);
             assertFalse(rs.next());
@@ -165,7 +168,7 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
         String transTableName = generateUniqueName();
         String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
         try (Connection conn = DriverManager.getConnection(getUrl())) {
-            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions);
+            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true");
             conn.setAutoCommit(true);
             // verify no rows returned
             ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + fullTableName);
@@ -178,7 +181,7 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
         String transTableName = generateUniqueName();
         String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
         try (Connection conn = DriverManager.getConnection(getUrl())) {
-            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions);
+            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true");
             conn.setAutoCommit(true);
             // verify no rows returned
             ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + fullTableName
+ " x JOIN " + fullTableName + " y ON (x.long_pk = y.int_pk)");
@@ -191,8 +194,8 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
         String t1 = generateUniqueName();
         String t2 = generateUniqueName();
         try (Connection conn = DriverManager.getConnection(getUrl())) {
-            conn.createStatement().execute("create table " + t1 + " (varchar_pk VARCHAR NOT
NULL primary key, a.varchar_col1 VARCHAR, b.varchar_col2 VARCHAR)" + tableDDLOptions);
-            conn.createStatement().execute("create table " + t2 + " (varchar_pk VARCHAR NOT
NULL primary key, a.varchar_col1 VARCHAR, b.varchar_col1 VARCHAR)" + tableDDLOptions);
+            conn.createStatement().execute("create table " + t1 + " (varchar_pk VARCHAR NOT
NULL primary key, a.varchar_col1 VARCHAR, b.varchar_col2 VARCHAR)" + tableDDLOptions + (tableDDLOptions.length()
> 0 ? "," : "") + "TRANSACTIONAL=true");
+            conn.createStatement().execute("create table " + t2 + " (varchar_pk VARCHAR NOT
NULL primary key, a.varchar_col1 VARCHAR, b.varchar_col1 VARCHAR)" + tableDDLOptions + (tableDDLOptions.length()
> 0 ? "," : "") + "TRANSACTIONAL=true");
             // verify no rows returned
             ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + t1 + "
x JOIN " + t1 + " y ON (x.varchar_pk = y.a.varchar_col1)");
             assertFalse(rs.next());
@@ -242,7 +245,7 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
         String transTableName = generateUniqueName();
         String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
         Connection conn = DriverManager.getConnection(getUrl());
-        conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions);
+        conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true");
         testRowConflicts(fullTableName);
     }
     
@@ -251,7 +254,7 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
         String transTableName = generateUniqueName();
         String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
         Connection conn = DriverManager.getConnection(getUrl());
-        conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions);
+        conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true");
         conn.createStatement().execute("ALTER TABLE " + fullTableName + " SET IMMUTABLE_ROWS=true");
         testRowConflicts(fullTableName);
     }
@@ -369,7 +372,7 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
         Connection conn = DriverManager.getConnection(getUrl(), props);
         String t1 = generateUniqueName();
         String t2 = generateUniqueName();
-        String ddl = "CREATE TABLE " + t1 + " (k varchar primary key) " + tableDDLOptions;
+        String ddl = "CREATE TABLE " + t1 + " (k varchar primary key)" + tableDDLOptions
+ (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true";
         conn.createStatement().execute(ddl);
         PhoenixConnection pconn = conn.unwrap(PhoenixConnection.class);
         PTable table = pconn.getTable(new PTableKey(null, t1));
@@ -418,7 +421,7 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
         String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
         String selectSql = "SELECT current_date() FROM "+fullTableName;
         try (Connection conn = DriverManager.getConnection(getUrl())) {
-            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions);
+            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA
+ tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true");
             conn.setAutoCommit(false);
             ResultSet rs = conn.createStatement().executeQuery(selectSql);
             assertFalse(rs.next());
@@ -458,9 +461,9 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
         String fullTableName2 = generateUniqueName();
         String sequenceName = "S_" + generateUniqueName();
         conn.createStatement().execute("CREATE SEQUENCE " + sequenceName);
-        conn.createStatement().execute("CREATE TABLE " + fullTableName1 + " (pk INTEGER PRIMARY
KEY, val INTEGER) SALT_BUCKETS=4"
-                + (!tableDDLOptions.isEmpty()? "," : "") + tableDDLOptions);
-        conn.createStatement().execute("CREATE TABLE " + fullTableName2 + " (pk INTEGER PRIMARY
KEY, val INTEGER)" + tableDDLOptions);
+        conn.createStatement().execute("CREATE TABLE " + fullTableName1 + " (pk INTEGER PRIMARY
KEY, val INTEGER) SALT_BUCKETS=4, TRANSACTIONAL=true"
+                + (tableDDLOptions.length() > 0 ? "," : "")  + tableDDLOptions);
+        conn.createStatement().execute("CREATE TABLE " + fullTableName2 + " (pk INTEGER PRIMARY
KEY, val INTEGER)" );
 
         for (int i = 0; i < 100; i++) {
             conn.createStatement().execute("UPSERT INTO " + fullTableName1 + " VALUES (NEXT
VALUE FOR " + sequenceName + ", " + (i%10) + ")");
@@ -478,7 +481,7 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT
{
         try (Connection conn = DriverManager.getConnection(getUrl())) {
             String transactTableName = generateUniqueName();
             Statement stmt = conn.createStatement();
-            stmt.execute("CREATE TABLE " + transactTableName + " (k VARCHAR PRIMARY KEY,
v1 VARCHAR, v2 VARCHAR) " + tableDDLOptions);
+            stmt.execute("CREATE TABLE " + transactTableName + " (k VARCHAR PRIMARY KEY,
v1 VARCHAR, v2 VARCHAR) " + tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "")
+ "TRANSACTIONAL=true");
 
             
             try (Connection conn1 = DriverManager.getConnection(getUrl()); Connection conn2
= DriverManager.getConnection(getUrl())) {


Mime
View raw message