phoenix git commit: PHOENIX-1577 addendum - handle resultSet.getTimeStamp(int colIndex, Calendar cal) too

2015-03-10 Thread samarth
Repository: phoenix
Updated Branches:
  refs/heads/4.0 89df0eeba - 04ceb5fe2


PHOENIX-1577 addendum - handle resultSet.getTimeStamp(int colIndex, Calendar 
cal) too


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

Branch: refs/heads/4.0
Commit: 04ceb5fe2e22b557546d63df092f78ce2044278d
Parents: 89df0ee
Author: Samarth samarth.j...@salesforce.com
Authored: Tue Mar 10 19:49:17 2015 -0700
Committer: Samarth samarth.j...@salesforce.com
Committed: Tue Mar 10 19:49:17 2015 -0700

--
 .../apache/phoenix/end2end/TimezoneOffsetFunctionIT.java  |  3 +++
 .../java/org/apache/phoenix/jdbc/PhoenixResultSet.java| 10 +-
 2 files changed, 4 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/04ceb5fe/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
index 96142ed..6ff6357 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
@@ -179,6 +179,9 @@ public class TimezoneOffsetFunctionIT extends 
BaseHBaseManagedTimeIT {
 ResultSet rs = conn.createStatement().executeQuery(query);
 rs.next();
 assertEquals(new Timestamp(time), rs.getTimestamp(1));
+assertEquals(new Timestamp(time), rs.getTimestamp(V));
+assertEquals(new Timestamp(time), rs.getTimestamp(1, cal));
+assertEquals(new Timestamp(time), rs.getTimestamp(V, cal));
 }
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/04ceb5fe/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java 
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
index 7d91dbb..49e384c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
@@ -652,15 +652,7 @@ public class PhoenixResultSet implements ResultSet, 
SQLCloseable, org.apache.pho
 
 @Override
 public Timestamp getTimestamp(int columnIndex, Calendar cal) throws 
SQLException {
-checkCursorState();
-Timestamp value = 
(Timestamp)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
-PTimestamp.INSTANCE, ptr);
-wasNull = (value == null);
-if (value == null) {
-return null;
-}
-cal.setTime(value); //this resets the millisecond part of timestamp 
according to the time zone of the calendar.
-return DateUtil.getTimestamp(cal.getTimeInMillis(), value.getNanos());
+return getTimestamp(columnIndex);
 }
 
 @Override



Apache-Phoenix | Master | Build Successful

2015-03-10 Thread Apache Jenkins Server
Master branch build status Successful
Source repository https://git-wip-us.apache.org/repos/asf/phoenix.git

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
[samarth.jain] PHOENIX-1577 addendum - fix bug in  resultSet.getTimeStamp(int colIndex, Calendar cal) too



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-1724 Update MetaDataProtocol patch version for 4.3.1

2015-03-10 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.3 8b6ab90a7 - 7f1b7cac5


PHOENIX-1724 Update MetaDataProtocol patch version for 4.3.1


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

Branch: refs/heads/4.3
Commit: 7f1b7cac5d5379c47951a05094e3c3a25082a83d
Parents: 8b6ab90
Author: James Taylor jtay...@salesforce.com
Authored: Tue Mar 10 11:10:35 2015 -0700
Committer: James Taylor jtay...@salesforce.com
Committed: Tue Mar 10 11:10:35 2015 -0700

--
 .../main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7f1b7cac/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
index 26a313d..a832b01 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
@@ -53,7 +53,7 @@ import com.google.protobuf.HBaseZeroCopyByteString;
 public abstract class MetaDataProtocol extends MetaDataService {
 public static final int PHOENIX_MAJOR_VERSION = 4;
 public static final int PHOENIX_MINOR_VERSION = 3;
-public static final int PHOENIX_PATCH_NUMBER = 0;
+public static final int PHOENIX_PATCH_NUMBER = 1;
 public static final int PHOENIX_VERSION =
 VersionUtil.encodeVersion(PHOENIX_MAJOR_VERSION, 
PHOENIX_MINOR_VERSION, PHOENIX_PATCH_NUMBER);
 



phoenix git commit: PHOENIX-1709 And expression of primary key RVCs can not compile

2015-03-10 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/3.0 1c0d30eab - 063865096


PHOENIX-1709 And expression of primary key RVCs can not compile

Conflicts:

phoenix-core/src/test/java/org/apache/phoenix/compile/WhereOptimizerTest.java


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

Branch: refs/heads/3.0
Commit: 0638650969690f68d046542d420bab25065a14bc
Parents: 1c0d30e
Author: James Taylor jtay...@salesforce.com
Authored: Sat Mar 7 10:24:18 2015 -0800
Committer: James Taylor jtay...@salesforce.com
Committed: Tue Mar 10 10:40:49 2015 -0700

--
 .../apache/phoenix/compile/WhereOptimizer.java  | 28 +++---
 .../org/apache/phoenix/schema/RowKeySchema.java | 39 ++--
 .../phoenix/compile/WhereOptimizerTest.java | 37 +++
 3 files changed, 85 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/06386509/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
index 9367992..bc9e8e8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
@@ -68,7 +68,6 @@ import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.StringUtil;
 
-import com.google.common.base.Preconditions;
 import com.google.common.collect.Iterators;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
@@ -1067,9 +1066,6 @@ public class WhereOptimizer {
 }
 
 public final KeySlot intersect(KeySlot that) {
-Preconditions.checkArgument(!this.keyRanges.isEmpty());
-Preconditions.checkArgument(!that.keyRanges.isEmpty());
-
 if (this.getPKSpan() == 1  that.getPKSpan() == 1) {
 if (this.getPKPosition() != that.getPKPosition()) {
 throw new IllegalArgumentException(Position must be 
equal for intersect);
@@ -1101,8 +1097,6 @@ public class WhereOptimizer {
 } else {
 assert(this.getPKSpan()  1);
 assert(this.getPKPosition() = that.getPKPosition());
-int position = this.getPKPosition();
-int thatPosition = that.getPKPosition();
 ListKeyRange newKeyRanges = 
Lists.newArrayListWithExpectedSize(this.getKeyRanges().size());
 // We know we have a set of RVCs (i.e. multi-span key 
ranges)
 // Get the PK slot value in the RVC for the position 
of the other KeySlot
@@ -,17 +1105,21 @@ public class WhereOptimizer {
 for (KeyRange keyRange : this.getKeyRanges()) {
 assert(keyRange.isSingleKey());
 byte[] key = keyRange.getLowerRange();
-schema.iterator(key, ptr); // initialize for 
iteration
-while (position  thatPosition) { // skip to part 
of RVC that overlaps
-schema.next(ptr, position++, key.length);
-}
-// Create a range just for the overlapping column
-ListKeyRange slotKeyRanges = 
Collections.singletonList(KeyRange.getKeyRange(ByteUtil.copyKeyBytesIfNecessary(ptr)));
-// Intersect with other ranges and add to list if 
it overlaps
-if 
(!isDegenerate(KeyRange.intersect(slotKeyRanges, that.getKeyRanges( {
-newKeyRanges.add(keyRange);
+int position = this.getPKPosition();
+int thatPosition = that.getPKPosition();
+ptr.set(key);
+if (schema.position(ptr, position, thatPosition)) {
+// Create a range just for the overlapping 
column
+ListKeyRange slotKeyRanges = 
Collections.singletonList(KeyRange.getKeyRange(ByteUtil.copyKeyBytesIfNecessary(ptr)));
+// Intersect with other ranges and add to list 
if it overlaps
+if 
(!isDegenerate(KeyRange.intersect(slotKeyRanges, that.getKeyRanges( {
+  

phoenix git commit: PHOENIX-1577 addendum - fix bug in resultSet.getTimeStamp(int colIndex, Calendar cal) too

2015-03-10 Thread samarth
Repository: phoenix
Updated Branches:
  refs/heads/master dee6f9d38 - 80a50c964


PHOENIX-1577 addendum - fix bug in  resultSet.getTimeStamp(int colIndex, 
Calendar cal) too


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

Branch: refs/heads/master
Commit: 80a50c964e94608c263471c1eca0c81e44ea5b19
Parents: dee6f9d
Author: Samarth samarth.j...@salesforce.com
Authored: Tue Mar 10 15:48:59 2015 -0700
Committer: Samarth samarth.j...@salesforce.com
Committed: Tue Mar 10 19:33:36 2015 -0700

--
 .../apache/phoenix/end2end/TimezoneOffsetFunctionIT.java  |  3 +++
 .../java/org/apache/phoenix/jdbc/PhoenixResultSet.java| 10 +-
 2 files changed, 4 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/80a50c96/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
index 96142ed..6ff6357 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
@@ -179,6 +179,9 @@ public class TimezoneOffsetFunctionIT extends 
BaseHBaseManagedTimeIT {
 ResultSet rs = conn.createStatement().executeQuery(query);
 rs.next();
 assertEquals(new Timestamp(time), rs.getTimestamp(1));
+assertEquals(new Timestamp(time), rs.getTimestamp(V));
+assertEquals(new Timestamp(time), rs.getTimestamp(1, cal));
+assertEquals(new Timestamp(time), rs.getTimestamp(V, cal));
 }
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/80a50c96/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java 
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
index 7d91dbb..49e384c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
@@ -652,15 +652,7 @@ public class PhoenixResultSet implements ResultSet, 
SQLCloseable, org.apache.pho
 
 @Override
 public Timestamp getTimestamp(int columnIndex, Calendar cal) throws 
SQLException {
-checkCursorState();
-Timestamp value = 
(Timestamp)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
-PTimestamp.INSTANCE, ptr);
-wasNull = (value == null);
-if (value == null) {
-return null;
-}
-cal.setTime(value); //this resets the millisecond part of timestamp 
according to the time zone of the calendar.
-return DateUtil.getTimestamp(cal.getTimeInMillis(), value.getNanos());
+return getTimestamp(columnIndex);
 }
 
 @Override



phoenix git commit: PHOENIX-1709 And expression of primary key RVCs can not compile

2015-03-10 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.0 b99d4e500 - 89df0eeba


PHOENIX-1709 And expression of primary key RVCs can not compile


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

Branch: refs/heads/4.0
Commit: 89df0eebacc554d24af4f3f49494e94915c107cd
Parents: b99d4e5
Author: James Taylor jtay...@salesforce.com
Authored: Sat Mar 7 10:24:18 2015 -0800
Committer: James Taylor jtay...@salesforce.com
Committed: Tue Mar 10 09:00:20 2015 -0700

--
 .../apache/phoenix/compile/WhereOptimizer.java  | 28 +++---
 .../org/apache/phoenix/schema/RowKeySchema.java | 39 ++--
 .../phoenix/compile/WhereOptimizerTest.java | 38 +++
 3 files changed, 86 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/89df0eeb/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
index a1a349a..713076e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
@@ -71,7 +71,6 @@ import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.StringUtil;
 
-import com.google.common.base.Preconditions;
 import com.google.common.collect.Iterators;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
@@ -1068,9 +1067,6 @@ public class WhereOptimizer {
 }
 
 public final KeySlot intersect(KeySlot that) {
-Preconditions.checkArgument(!this.keyRanges.isEmpty());
-Preconditions.checkArgument(!that.keyRanges.isEmpty());
-
 if (this.getPKSpan() == 1  that.getPKSpan() == 1) {
 if (this.getPKPosition() != that.getPKPosition()) {
 throw new IllegalArgumentException(Position must be 
equal for intersect);
@@ -1102,8 +1098,6 @@ public class WhereOptimizer {
 } else {
 assert(this.getPKSpan()  1);
 assert(this.getPKPosition() = that.getPKPosition());
-int position = this.getPKPosition();
-int thatPosition = that.getPKPosition();
 ListKeyRange newKeyRanges = 
Lists.newArrayListWithExpectedSize(this.getKeyRanges().size());
 // We know we have a set of RVCs (i.e. multi-span key 
ranges)
 // Get the PK slot value in the RVC for the position 
of the other KeySlot
@@ -1112,17 +1106,21 @@ public class WhereOptimizer {
 for (KeyRange keyRange : this.getKeyRanges()) {
 assert(keyRange.isSingleKey());
 byte[] key = keyRange.getLowerRange();
-schema.iterator(key, ptr); // initialize for 
iteration
-while (position  thatPosition) { // skip to part 
of RVC that overlaps
-schema.next(ptr, position++, key.length);
-}
-// Create a range just for the overlapping column
-ListKeyRange slotKeyRanges = 
Collections.singletonList(KeyRange.getKeyRange(ByteUtil.copyKeyBytesIfNecessary(ptr)));
-// Intersect with other ranges and add to list if 
it overlaps
-if 
(!isDegenerate(KeyRange.intersect(slotKeyRanges, that.getKeyRanges( {
-newKeyRanges.add(keyRange);
+int position = this.getPKPosition();
+int thatPosition = that.getPKPosition();
+ptr.set(key);
+if (schema.position(ptr, position, thatPosition)) {
+// Create a range just for the overlapping 
column
+ListKeyRange slotKeyRanges = 
Collections.singletonList(KeyRange.getKeyRange(ByteUtil.copyKeyBytesIfNecessary(ptr)));
+// Intersect with other ranges and add to list 
if it overlaps
+if 
(!isDegenerate(KeyRange.intersect(slotKeyRanges, that.getKeyRanges( {
+newKeyRanges.add(keyRange);
+}
  

Apache-Phoenix | 3.0 | Hadoop1 | Build Successful

2015-03-10 Thread Apache Jenkins Server
3.0 branch build status Successful
Source repository https://git-wip-us.apache.org/repos/asf/phoenix.git

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

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

Changes
[jtaylor] PHOENIX-1709 And _expression_ of primary key RVCs can not compile



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


phoenix git commit: Basic configuration of a transactional table

2015-03-10 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/txn 00976e81b - 995e352c6


Basic configuration of a transactional table


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

Branch: refs/heads/txn
Commit: 995e352c6971fc51888a25bfd0a5b7b737eee958
Parents: 00976e8
Author: James Taylor jtay...@salesforce.com
Authored: Tue Mar 10 16:34:05 2015 -0700
Committer: James Taylor jtay...@salesforce.com
Committed: Tue Mar 10 16:34:05 2015 -0700

--
 .../apache/phoenix/end2end/AlterTableIT.java| 55 
 .../apache/phoenix/compile/PostDDLCompiler.java | 31 +--
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java   |  3 ++
 .../query/ConnectionQueryServicesImpl.java  | 44 ++--
 .../org/apache/phoenix/query/HTableFactory.java |  9 +++-
 .../apache/phoenix/schema/MetaDataClient.java   |  4 +-
 .../org/apache/phoenix/util/SchemaUtil.java | 11 
 7 files changed, 147 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/995e352c/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
--
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 59698d6..9c0171f 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
@@ -38,10 +38,15 @@ import java.util.Collections;
 import java.util.Map;
 import java.util.Properties;
 
+import co.cask.tephra.hbase98.TransactionAwareHTable;
+import co.cask.tephra.hbase98.coprocessor.TransactionProcessor;
+
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.KeepDeletedCells;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.phoenix.coprocessor.MetaDataProtocol;
 import org.apache.phoenix.exception.SQLExceptionCode;
@@ -50,6 +55,7 @@ import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.schema.PTableKey;
+import org.apache.phoenix.schema.TableAlreadyExistsException;
 import org.apache.phoenix.schema.TableNotFoundException;
 import org.apache.phoenix.util.IndexUtil;
 import org.apache.phoenix.util.PhoenixRuntime;
@@ -1988,4 +1994,53 @@ public class AlterTableIT extends 
BaseOwnClusterHBaseManagedTimeIT {
 conn.close();
 }
 }
+
+@Test
+public void testAlterTableToBeTransactional() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = CREATE TABLE test_table (k varchar primary key);
+createTestTable(getUrl(), ddl);
+
+try {
+ddl = ALTER TABLE test_table SET transactional=true;
+conn.createStatement().execute(ddl);
+fail();
+} catch (SQLException e) {
+
assertEquals(SQLExceptionCode.SET_UNSUPPORTED_PROP_ON_ALTER_TABLE.getErrorCode(),e.getErrorCode());
+}
+}
+
+
+@Test
+public void testCreateTableToBeTransactional() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = CREATE TABLE TEST_TRANSACTIONAL_TABLE (k varchar primary 
key) transactional=true;
+conn.createStatement().execute(ddl);
+PhoenixConnection pconn = conn.unwrap(PhoenixConnection.class);
+HTableInterface htable = 
pconn.getQueryServices().getTable(Bytes.toBytes(TEST_TRANSACTIONAL_TABLE));
+assertTrue(SchemaUtil.isTransactional(htable.getTableDescriptor()));
+assertTrue(htable instanceof TransactionAwareHTable);
+
assertTrue(htable.getTableDescriptor().getCoprocessors().contains(TransactionProcessor.class.getName()));
+
+HBaseAdmin admin = pconn.getQueryServices().getAdmin();
+HTableDescriptor desc = new 
HTableDescriptor(TableName.valueOf(TXN_TEST_EXISTING));
+desc.addFamily(new 
HColumnDescriptor(QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES));
+admin.createTable(desc);
+try {
+ddl = CREATE TABLE TXN_TEST_EXISTING (k varchar primary key) 
transactional=true;
+