phoenix git commit: PHOENIX-3837 Feature enabling to set property on an index with Alter statement PHOENIX-4361 Remove redundant argument in separateAndValidateProperties in CQSI pSigned-off-by: aerto

2018-02-23 Thread ewang
Repository: phoenix
Updated Branches:
  refs/heads/5.x-HBase-2.0 6c9855139 -> beb3a7676


PHOENIX-3837 Feature enabling to set property on an index with Alter statement
PHOENIX-4361 Remove redundant argument in separateAndValidateProperties in CQSI
pSigned-off-by: aertoria 


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

Branch: refs/heads/5.x-HBase-2.0
Commit: beb3a767690f4faafb6ee08ae0b14a5a8f3133d5
Parents: 6c98551
Author: aertoria 
Authored: Mon Nov 27 11:58:01 2017 -0800
Committer: aertoria 
Committed: Fri Feb 23 13:06:50 2018 -0800

--
 .../apache/phoenix/end2end/AlterTableIT.java|   2 +-
 .../phoenix/end2end/index/IndexMetadataIT.java  |  55 ++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |   5 +-
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  10 +-
 .../phoenix/parse/AddColumnStatement.java   |   2 +-
 .../phoenix/parse/AlterIndexStatement.java  |  14 +
 .../apache/phoenix/parse/ParseNodeFactory.java  |   6 +-
 .../phoenix/query/ConnectionQueryServices.java  |   2 +
 .../query/ConnectionQueryServicesImpl.java  |  25 +-
 .../query/ConnectionlessQueryServicesImpl.java  |  10 +-
 .../query/DelegateConnectionQueryServices.java  |   8 +-
 .../apache/phoenix/schema/MetaDataClient.java   | 572 +--
 12 files changed, 530 insertions(+), 181 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/beb3a767/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 cfc59bd..4e731c1 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
@@ -1081,7 +1081,7 @@ public class AlterTableIT extends ParallelStatsDisabledIT 
{
} catch (SQLException e) {

assertEquals(SQLExceptionCode.CANNOT_CREATE_TXN_TABLE_IF_TXNS_DISABLED.getErrorCode(),
 e.getErrorCode());
}
-   // altering a table to be transactional  should fail if 
transactions are disabled
+   // altering a table to be transactional should fail if 
transactions are disabled
conn.createStatement().execute("CREATE TABLE " + 
dataTableFullName + "(k INTEGER PRIMARY KEY, v VARCHAR)");
try {
conn.createStatement().execute("ALTER TABLE " + 
dataTableFullName + " SET TRANSACTIONAL=true");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/beb3a767/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
index 0ce36dd..986c317 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
@@ -674,4 +674,59 @@ public class IndexMetadataIT extends 
ParallelStatsDisabledIT {
 conn.close();
 }
 }
+
+
+
+@Test
+public void testIndexAlterPhoenixProperty() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String testTable = generateUniqueName();
+
+
+String ddl = "create table " + testTable  + " (k varchar primary key, 
v1 varchar)";
+Statement stmt = conn.createStatement();
+stmt.execute(ddl);
+String indexName = "IDX_" + generateUniqueName();
+
+ddl = "CREATE INDEX " + indexName + " ON " + testTable  + " (v1) ";
+stmt.execute(ddl);
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 10");
+
+ResultSet rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+assertEquals(10,rs.getInt(1));
+
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 20");
+rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH 

[31/35] phoenix git commit: PHOENIX-3837 Feature enabling to set property on an index with Alter statement

2018-01-31 Thread pboado
PHOENIX-3837 Feature enabling to set property on an index with Alter statement

Signed-off-by: aertoria 


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

Branch: refs/heads/4.x-cdh5.11.2
Commit: cc44562890709defea6820e7b0cb4f24fc9df393
Parents: 310b38c
Author: aertoria 
Authored: Mon Nov 27 03:13:53 2017 +
Committer: Pedro Boado 
Committed: Wed Jan 31 22:24:48 2018 +

--
 .../apache/phoenix/end2end/AlterTableIT.java|   2 +-
 .../phoenix/end2end/index/IndexMetadataIT.java  |  55 ++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |   5 +-
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  10 +-
 .../phoenix/parse/AddColumnStatement.java   |   2 +-
 .../phoenix/parse/AlterIndexStatement.java  |  14 +
 .../apache/phoenix/parse/ParseNodeFactory.java  |   6 +-
 .../phoenix/query/ConnectionQueryServices.java  |   2 +
 .../query/ConnectionQueryServicesImpl.java  |  20 +
 .../query/ConnectionlessQueryServicesImpl.java  |   7 +
 .../query/DelegateConnectionQueryServices.java  |   8 +-
 .../apache/phoenix/schema/MetaDataClient.java   | 566 +--
 12 files changed, 520 insertions(+), 177 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/cc445628/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 5265b09..17f08c4 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
@@ -1080,7 +1080,7 @@ public class AlterTableIT extends ParallelStatsDisabledIT 
{
} catch (SQLException e) {

assertEquals(SQLExceptionCode.CANNOT_CREATE_TXN_TABLE_IF_TXNS_DISABLED.getErrorCode(),
 e.getErrorCode());
}
-   // altering a table to be transactional  should fail if 
transactions are disabled
+   // altering a table to be transactional should fail if 
transactions are disabled
conn.createStatement().execute("CREATE TABLE " + 
dataTableFullName + "(k INTEGER PRIMARY KEY, v VARCHAR)");
try {
conn.createStatement().execute("ALTER TABLE " + 
dataTableFullName + " SET TRANSACTIONAL=true");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/cc445628/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
index 0ce36dd..986c317 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
@@ -674,4 +674,59 @@ public class IndexMetadataIT extends 
ParallelStatsDisabledIT {
 conn.close();
 }
 }
+
+
+
+@Test
+public void testIndexAlterPhoenixProperty() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String testTable = generateUniqueName();
+
+
+String ddl = "create table " + testTable  + " (k varchar primary key, 
v1 varchar)";
+Statement stmt = conn.createStatement();
+stmt.execute(ddl);
+String indexName = "IDX_" + generateUniqueName();
+
+ddl = "CREATE INDEX " + indexName + " ON " + testTable  + " (v1) ";
+stmt.execute(ddl);
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 10");
+
+ResultSet rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+assertEquals(10,rs.getInt(1));
+
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 20");
+rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+assertEquals(20,rs.getInt(1));
+}
+
+
+@Test
+public void 

[26/50] [abbrv] phoenix git commit: PHOENIX-3837 Feature enabling to set property on an index with Alter statement

2018-01-19 Thread tdsilva
PHOENIX-3837 Feature enabling to set property on an index with Alter statement

Signed-off-by: aertoria 


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

Branch: refs/heads/system-catalog
Commit: 1c3387d0eb2fcec2423dda029aa65ca66f547416
Parents: ee728a4
Author: aertoria 
Authored: Mon Nov 27 11:58:01 2017 -0800
Committer: aertoria 
Committed: Thu Dec 7 11:51:17 2017 -0800

--
 .../apache/phoenix/end2end/AlterTableIT.java|   2 +-
 .../phoenix/end2end/index/IndexMetadataIT.java  |  55 ++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |   5 +-
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  10 +-
 .../phoenix/parse/AddColumnStatement.java   |   2 +-
 .../phoenix/parse/AlterIndexStatement.java  |  14 +
 .../apache/phoenix/parse/ParseNodeFactory.java  |   6 +-
 .../phoenix/query/ConnectionQueryServices.java  |   2 +
 .../query/ConnectionQueryServicesImpl.java  |  20 +
 .../query/ConnectionlessQueryServicesImpl.java  |   7 +
 .../query/DelegateConnectionQueryServices.java  |   8 +-
 .../apache/phoenix/schema/MetaDataClient.java   | 566 +--
 12 files changed, 520 insertions(+), 177 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1c3387d0/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 5265b09..17f08c4 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
@@ -1080,7 +1080,7 @@ public class AlterTableIT extends ParallelStatsDisabledIT 
{
} catch (SQLException e) {

assertEquals(SQLExceptionCode.CANNOT_CREATE_TXN_TABLE_IF_TXNS_DISABLED.getErrorCode(),
 e.getErrorCode());
}
-   // altering a table to be transactional  should fail if 
transactions are disabled
+   // altering a table to be transactional should fail if 
transactions are disabled
conn.createStatement().execute("CREATE TABLE " + 
dataTableFullName + "(k INTEGER PRIMARY KEY, v VARCHAR)");
try {
conn.createStatement().execute("ALTER TABLE " + 
dataTableFullName + " SET TRANSACTIONAL=true");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1c3387d0/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
index 0ce36dd..986c317 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
@@ -674,4 +674,59 @@ public class IndexMetadataIT extends 
ParallelStatsDisabledIT {
 conn.close();
 }
 }
+
+
+
+@Test
+public void testIndexAlterPhoenixProperty() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String testTable = generateUniqueName();
+
+
+String ddl = "create table " + testTable  + " (k varchar primary key, 
v1 varchar)";
+Statement stmt = conn.createStatement();
+stmt.execute(ddl);
+String indexName = "IDX_" + generateUniqueName();
+
+ddl = "CREATE INDEX " + indexName + " ON " + testTable  + " (v1) ";
+stmt.execute(ddl);
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 10");
+
+ResultSet rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+assertEquals(10,rs.getInt(1));
+
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 20");
+rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+assertEquals(20,rs.getInt(1));
+}
+
+
+@Test
+public void 

[02/16] phoenix git commit: PHOENIX-3837 Feature enabling to set property on an index with Alter statement

2017-12-16 Thread jamestaylor
PHOENIX-3837 Feature enabling to set property on an index with Alter statement

Signed-off-by: aertoria 


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

Branch: refs/heads/4.x-HBase-1.2
Commit: ef174bb22ccce806dcdf5435d17319cbfa86c0d5
Parents: 5b49396
Author: aertoria 
Authored: Mon Nov 27 03:13:53 2017 +
Committer: James Taylor 
Committed: Sat Dec 16 16:42:54 2017 -0800

--
 .../apache/phoenix/end2end/AlterTableIT.java|   2 +-
 .../phoenix/end2end/index/IndexMetadataIT.java  |  55 ++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |   5 +-
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  10 +-
 .../phoenix/parse/AddColumnStatement.java   |   2 +-
 .../phoenix/parse/AlterIndexStatement.java  |  14 +
 .../apache/phoenix/parse/ParseNodeFactory.java  |   6 +-
 .../phoenix/query/ConnectionQueryServices.java  |   2 +
 .../query/ConnectionQueryServicesImpl.java  |  20 +
 .../query/ConnectionlessQueryServicesImpl.java  |   7 +
 .../query/DelegateConnectionQueryServices.java  |   8 +-
 .../apache/phoenix/schema/MetaDataClient.java   | 566 +--
 12 files changed, 520 insertions(+), 177 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ef174bb2/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 5265b09..17f08c4 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
@@ -1080,7 +1080,7 @@ public class AlterTableIT extends ParallelStatsDisabledIT 
{
} catch (SQLException e) {

assertEquals(SQLExceptionCode.CANNOT_CREATE_TXN_TABLE_IF_TXNS_DISABLED.getErrorCode(),
 e.getErrorCode());
}
-   // altering a table to be transactional  should fail if 
transactions are disabled
+   // altering a table to be transactional should fail if 
transactions are disabled
conn.createStatement().execute("CREATE TABLE " + 
dataTableFullName + "(k INTEGER PRIMARY KEY, v VARCHAR)");
try {
conn.createStatement().execute("ALTER TABLE " + 
dataTableFullName + " SET TRANSACTIONAL=true");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ef174bb2/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
index 0ce36dd..986c317 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
@@ -674,4 +674,59 @@ public class IndexMetadataIT extends 
ParallelStatsDisabledIT {
 conn.close();
 }
 }
+
+
+
+@Test
+public void testIndexAlterPhoenixProperty() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String testTable = generateUniqueName();
+
+
+String ddl = "create table " + testTable  + " (k varchar primary key, 
v1 varchar)";
+Statement stmt = conn.createStatement();
+stmt.execute(ddl);
+String indexName = "IDX_" + generateUniqueName();
+
+ddl = "CREATE INDEX " + indexName + " ON " + testTable  + " (v1) ";
+stmt.execute(ddl);
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 10");
+
+ResultSet rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+assertEquals(10,rs.getInt(1));
+
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 20");
+rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+assertEquals(20,rs.getInt(1));
+}
+
+
+@Test
+public 

phoenix git commit: PHOENIX-3837 Feature enabling to set property on an index with Alter statement

2017-12-07 Thread ewang
Repository: phoenix
Updated Branches:
  refs/heads/master ee728a4d1 -> 1c3387d0e


PHOENIX-3837 Feature enabling to set property on an index with Alter statement

Signed-off-by: aertoria 


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

Branch: refs/heads/master
Commit: 1c3387d0eb2fcec2423dda029aa65ca66f547416
Parents: ee728a4
Author: aertoria 
Authored: Mon Nov 27 11:58:01 2017 -0800
Committer: aertoria 
Committed: Thu Dec 7 11:51:17 2017 -0800

--
 .../apache/phoenix/end2end/AlterTableIT.java|   2 +-
 .../phoenix/end2end/index/IndexMetadataIT.java  |  55 ++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |   5 +-
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  10 +-
 .../phoenix/parse/AddColumnStatement.java   |   2 +-
 .../phoenix/parse/AlterIndexStatement.java  |  14 +
 .../apache/phoenix/parse/ParseNodeFactory.java  |   6 +-
 .../phoenix/query/ConnectionQueryServices.java  |   2 +
 .../query/ConnectionQueryServicesImpl.java  |  20 +
 .../query/ConnectionlessQueryServicesImpl.java  |   7 +
 .../query/DelegateConnectionQueryServices.java  |   8 +-
 .../apache/phoenix/schema/MetaDataClient.java   | 566 +--
 12 files changed, 520 insertions(+), 177 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1c3387d0/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 5265b09..17f08c4 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
@@ -1080,7 +1080,7 @@ public class AlterTableIT extends ParallelStatsDisabledIT 
{
} catch (SQLException e) {

assertEquals(SQLExceptionCode.CANNOT_CREATE_TXN_TABLE_IF_TXNS_DISABLED.getErrorCode(),
 e.getErrorCode());
}
-   // altering a table to be transactional  should fail if 
transactions are disabled
+   // altering a table to be transactional should fail if 
transactions are disabled
conn.createStatement().execute("CREATE TABLE " + 
dataTableFullName + "(k INTEGER PRIMARY KEY, v VARCHAR)");
try {
conn.createStatement().execute("ALTER TABLE " + 
dataTableFullName + " SET TRANSACTIONAL=true");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1c3387d0/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
index 0ce36dd..986c317 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
@@ -674,4 +674,59 @@ public class IndexMetadataIT extends 
ParallelStatsDisabledIT {
 conn.close();
 }
 }
+
+
+
+@Test
+public void testIndexAlterPhoenixProperty() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String testTable = generateUniqueName();
+
+
+String ddl = "create table " + testTable  + " (k varchar primary key, 
v1 varchar)";
+Statement stmt = conn.createStatement();
+stmt.execute(ddl);
+String indexName = "IDX_" + generateUniqueName();
+
+ddl = "CREATE INDEX " + indexName + " ON " + testTable  + " (v1) ";
+stmt.execute(ddl);
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 10");
+
+ResultSet rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+assertEquals(10,rs.getInt(1));
+
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 20");
+rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+   

phoenix git commit: PHOENIX-3837 Feature enabling to set property on an index with Alter statement

2017-12-07 Thread ewang
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 1df7aa5bb -> 794d42833


PHOENIX-3837 Feature enabling to set property on an index with Alter statement

Signed-off-by: aertoria 


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 794d4283392fdf80471c51f1c2055845848d979e
Parents: 1df7aa5
Author: aertoria 
Authored: Mon Nov 27 11:58:01 2017 -0800
Committer: aertoria 
Committed: Thu Dec 7 09:18:05 2017 -0800

--
 .../apache/phoenix/end2end/AlterTableIT.java|   2 +-
 .../phoenix/end2end/index/IndexMetadataIT.java  |  55 ++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |   5 +-
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  10 +-
 .../phoenix/parse/AddColumnStatement.java   |   2 +-
 .../phoenix/parse/AlterIndexStatement.java  |  14 +
 .../apache/phoenix/parse/ParseNodeFactory.java  |   6 +-
 .../phoenix/query/ConnectionQueryServices.java  |   2 +
 .../query/ConnectionQueryServicesImpl.java  |  20 +
 .../query/ConnectionlessQueryServicesImpl.java  |   7 +
 .../query/DelegateConnectionQueryServices.java  |   8 +-
 .../apache/phoenix/schema/MetaDataClient.java   | 566 +--
 12 files changed, 520 insertions(+), 177 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/794d4283/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 c21b023..ab75d34 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
@@ -1082,7 +1082,7 @@ public class AlterTableIT extends ParallelStatsDisabledIT 
{
} catch (SQLException e) {

assertEquals(SQLExceptionCode.CANNOT_CREATE_TXN_TABLE_IF_TXNS_DISABLED.getErrorCode(),
 e.getErrorCode());
}
-   // altering a table to be transactional  should fail if 
transactions are disabled
+   // altering a table to be transactional should fail if 
transactions are disabled
conn.createStatement().execute("CREATE TABLE " + 
dataTableFullName + "(k INTEGER PRIMARY KEY, v VARCHAR)");
try {
conn.createStatement().execute("ALTER TABLE " + 
dataTableFullName + " SET TRANSACTIONAL=true");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/794d4283/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
index 0ce36dd..986c317 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
@@ -674,4 +674,59 @@ public class IndexMetadataIT extends 
ParallelStatsDisabledIT {
 conn.close();
 }
 }
+
+
+
+@Test
+public void testIndexAlterPhoenixProperty() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String testTable = generateUniqueName();
+
+
+String ddl = "create table " + testTable  + " (k varchar primary key, 
v1 varchar)";
+Statement stmt = conn.createStatement();
+stmt.execute(ddl);
+String indexName = "IDX_" + generateUniqueName();
+
+ddl = "CREATE INDEX " + indexName + " ON " + testTable  + " (v1) ";
+stmt.execute(ddl);
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 10");
+
+ResultSet rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+assertEquals(10,rs.getInt(1));
+
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 20");
+rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName +