phoenix git commit: PHOENIX-1673 Allow TenantId to be of any integral data type
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.0 71c19099d - d6f9c678b PHOENIX-1673 Allow TenantId to be of any integral data type Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/d6f9c678 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d6f9c678 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d6f9c678 Branch: refs/heads/4.x-HBase-1.0 Commit: d6f9c678b98f2bbf88c9494749535abef412a4d2 Parents: 71c1909 Author: Jeffrey Lyons jeffrey.ly...@d2l.com Authored: Thu Jul 9 10:07:40 2015 -0400 Committer: Eli Levine elilev...@apache.org Committed: Fri Aug 14 13:07:52 2015 -0700 -- .../end2end/BaseTenantSpecificViewIndexIT.java | 33 ++- .../apache/phoenix/end2end/CreateTableIT.java | 25 ++ .../apache/phoenix/end2end/TenantIdTypeIT.java | 226 ++ .../end2end/TenantSpecificTablesDDLIT.java | 12 - .../end2end/TenantSpecificViewIndexIT.java | 5 + .../apache/phoenix/compile/DeleteCompiler.java | 3 +- .../apache/phoenix/compile/UpsertCompiler.java | 3 +- .../apache/phoenix/compile/WhereOptimizer.java | 11 +- .../phoenix/exception/SQLExceptionCode.java | 3 +- .../apache/phoenix/execute/BaseQueryPlan.java | 14 +- .../apache/phoenix/execute/MutationState.java | 24 +- .../apache/phoenix/schema/MetaDataClient.java | 4 +- .../java/org/apache/phoenix/util/ScanUtil.java | 34 ++- .../util/TenantIdByteConversionTest.java| 294 +++ 14 files changed, 632 insertions(+), 59 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/d6f9c678/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java index 93fc222..b450643 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java @@ -40,6 +40,7 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { public static final String TENANT1_ID = tenant1; public static final String TENANT2_ID = tenant2; +public static final String NON_STRING_TENANT_ID = 1234; protected SetPairString, String tenantViewsToDelete = newHashSet(); @@ -48,7 +49,7 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { } protected void testUpdatableView(Integer saltBuckets, boolean localIndex) throws Exception { -createBaseTable(t, saltBuckets); +createBaseTable(t, saltBuckets, true); Connection conn = createTenantConnection(TENANT1_ID); try { createAndPopulateTenantView(conn, TENANT1_ID, t, ); @@ -58,13 +59,25 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { try { conn.close();} catch (Exception ignored) {} } } + +protected void testUpdatableViewNonString(Integer saltBuckets, boolean localIndex) throws Exception { +createBaseTable(t, saltBuckets, false); +Connection conn = createTenantConnection(NON_STRING_TENANT_ID); +try { +createAndPopulateTenantView(conn, NON_STRING_TENANT_ID, t, ); +createAndVerifyIndexNonStringTenantId(conn, NON_STRING_TENANT_ID, ); +verifyViewData(conn, ); +} finally { +try { conn.close();} catch (Exception ignored) {} +} +} protected void testUpdatableViewsWithSameNameDifferentTenants(Integer saltBuckets) throws Exception { testUpdatableViewsWithSameNameDifferentTenants(saltBuckets, false); } protected void testUpdatableViewsWithSameNameDifferentTenants(Integer saltBuckets, boolean localIndex) throws Exception { -createBaseTable(t, saltBuckets); +createBaseTable(t, saltBuckets, true); Connection conn1 = createTenantConnection(TENANT1_ID); Connection conn2 = createTenantConnection(TENANT2_ID); try { @@ -86,9 +99,10 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { } } -private void createBaseTable(String tableName, Integer saltBuckets) throws SQLException { +private void createBaseTable(String tableName, Integer saltBuckets, boolean hasStringTenantId) throws SQLException { Connection conn = DriverManager.getConnection(getUrl()); -String ddl = CREATE TABLE + tableName + (t_id VARCHAR NOT NULL,\n + +String tenantIdType = hasStringTenantId ? VARCHAR : BIGINT; +
phoenix git commit: PHOENIX-1673 Allow TenantId to be of any integral data type
Repository: phoenix Updated Branches: refs/heads/master b28686fdb - 5c048430e PHOENIX-1673 Allow TenantId to be of any integral data type Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/5c048430 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5c048430 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5c048430 Branch: refs/heads/master Commit: 5c048430ed39ce23f95609607c1bd845401900a9 Parents: b28686f Author: Jeffrey Lyons jeffrey.ly...@d2l.com Authored: Thu Jul 9 10:07:40 2015 -0400 Committer: Eli Levine elilev...@apache.org Committed: Thu Aug 13 11:01:00 2015 -0700 -- .../end2end/BaseTenantSpecificViewIndexIT.java | 33 ++- .../apache/phoenix/end2end/CreateTableIT.java | 25 ++ .../apache/phoenix/end2end/TenantIdTypeIT.java | 226 ++ .../end2end/TenantSpecificTablesDDLIT.java | 12 - .../end2end/TenantSpecificViewIndexIT.java | 5 + .../apache/phoenix/compile/DeleteCompiler.java | 3 +- .../apache/phoenix/compile/UpsertCompiler.java | 3 +- .../apache/phoenix/compile/WhereOptimizer.java | 11 +- .../phoenix/exception/SQLExceptionCode.java | 3 +- .../apache/phoenix/execute/BaseQueryPlan.java | 14 +- .../apache/phoenix/execute/MutationState.java | 23 +- .../apache/phoenix/schema/MetaDataClient.java | 4 +- .../java/org/apache/phoenix/util/ScanUtil.java | 35 ++- .../util/TenantIdByteConversionTest.java| 294 +++ 14 files changed, 631 insertions(+), 60 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/5c048430/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java index 93fc222..b450643 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java @@ -40,6 +40,7 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { public static final String TENANT1_ID = tenant1; public static final String TENANT2_ID = tenant2; +public static final String NON_STRING_TENANT_ID = 1234; protected SetPairString, String tenantViewsToDelete = newHashSet(); @@ -48,7 +49,7 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { } protected void testUpdatableView(Integer saltBuckets, boolean localIndex) throws Exception { -createBaseTable(t, saltBuckets); +createBaseTable(t, saltBuckets, true); Connection conn = createTenantConnection(TENANT1_ID); try { createAndPopulateTenantView(conn, TENANT1_ID, t, ); @@ -58,13 +59,25 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { try { conn.close();} catch (Exception ignored) {} } } + +protected void testUpdatableViewNonString(Integer saltBuckets, boolean localIndex) throws Exception { +createBaseTable(t, saltBuckets, false); +Connection conn = createTenantConnection(NON_STRING_TENANT_ID); +try { +createAndPopulateTenantView(conn, NON_STRING_TENANT_ID, t, ); +createAndVerifyIndexNonStringTenantId(conn, NON_STRING_TENANT_ID, ); +verifyViewData(conn, ); +} finally { +try { conn.close();} catch (Exception ignored) {} +} +} protected void testUpdatableViewsWithSameNameDifferentTenants(Integer saltBuckets) throws Exception { testUpdatableViewsWithSameNameDifferentTenants(saltBuckets, false); } protected void testUpdatableViewsWithSameNameDifferentTenants(Integer saltBuckets, boolean localIndex) throws Exception { -createBaseTable(t, saltBuckets); +createBaseTable(t, saltBuckets, true); Connection conn1 = createTenantConnection(TENANT1_ID); Connection conn2 = createTenantConnection(TENANT2_ID); try { @@ -86,9 +99,10 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { } } -private void createBaseTable(String tableName, Integer saltBuckets) throws SQLException { +private void createBaseTable(String tableName, Integer saltBuckets, boolean hasStringTenantId) throws SQLException { Connection conn = DriverManager.getConnection(getUrl()); -String ddl = CREATE TABLE + tableName + (t_id VARCHAR NOT NULL,\n + +String tenantIdType = hasStringTenantId ? VARCHAR : BIGINT; +String ddl =
phoenix git commit: PHOENIX-1673 Allow TenantId to be of any integral data type
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 82c578e81 - 25cc14e09 PHOENIX-1673 Allow TenantId to be of any integral data type Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/25cc14e0 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/25cc14e0 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/25cc14e0 Branch: refs/heads/4.x-HBase-0.98 Commit: 25cc14e09e62952bb3b2f362f435baa285f05563 Parents: 82c578e Author: Jeffrey Lyons jeffrey.ly...@d2l.com Authored: Thu Jul 9 10:07:40 2015 -0400 Committer: Eli Levine elilev...@apache.org Committed: Thu Aug 13 14:18:31 2015 -0700 -- .../end2end/BaseTenantSpecificViewIndexIT.java | 33 ++- .../apache/phoenix/end2end/CreateTableIT.java | 25 ++ .../apache/phoenix/end2end/TenantIdTypeIT.java | 226 ++ .../end2end/TenantSpecificTablesDDLIT.java | 12 - .../end2end/TenantSpecificViewIndexIT.java | 5 + .../apache/phoenix/compile/DeleteCompiler.java | 3 +- .../apache/phoenix/compile/UpsertCompiler.java | 3 +- .../apache/phoenix/compile/WhereOptimizer.java | 11 +- .../phoenix/exception/SQLExceptionCode.java | 3 +- .../apache/phoenix/execute/BaseQueryPlan.java | 14 +- .../apache/phoenix/execute/MutationState.java | 24 +- .../apache/phoenix/schema/MetaDataClient.java | 4 +- .../java/org/apache/phoenix/util/ScanUtil.java | 34 ++- .../util/TenantIdByteConversionTest.java| 294 +++ 14 files changed, 632 insertions(+), 59 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/25cc14e0/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java index 93fc222..b450643 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java @@ -40,6 +40,7 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { public static final String TENANT1_ID = tenant1; public static final String TENANT2_ID = tenant2; +public static final String NON_STRING_TENANT_ID = 1234; protected SetPairString, String tenantViewsToDelete = newHashSet(); @@ -48,7 +49,7 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { } protected void testUpdatableView(Integer saltBuckets, boolean localIndex) throws Exception { -createBaseTable(t, saltBuckets); +createBaseTable(t, saltBuckets, true); Connection conn = createTenantConnection(TENANT1_ID); try { createAndPopulateTenantView(conn, TENANT1_ID, t, ); @@ -58,13 +59,25 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { try { conn.close();} catch (Exception ignored) {} } } + +protected void testUpdatableViewNonString(Integer saltBuckets, boolean localIndex) throws Exception { +createBaseTable(t, saltBuckets, false); +Connection conn = createTenantConnection(NON_STRING_TENANT_ID); +try { +createAndPopulateTenantView(conn, NON_STRING_TENANT_ID, t, ); +createAndVerifyIndexNonStringTenantId(conn, NON_STRING_TENANT_ID, ); +verifyViewData(conn, ); +} finally { +try { conn.close();} catch (Exception ignored) {} +} +} protected void testUpdatableViewsWithSameNameDifferentTenants(Integer saltBuckets) throws Exception { testUpdatableViewsWithSameNameDifferentTenants(saltBuckets, false); } protected void testUpdatableViewsWithSameNameDifferentTenants(Integer saltBuckets, boolean localIndex) throws Exception { -createBaseTable(t, saltBuckets); +createBaseTable(t, saltBuckets, true); Connection conn1 = createTenantConnection(TENANT1_ID); Connection conn2 = createTenantConnection(TENANT2_ID); try { @@ -86,9 +99,10 @@ public class BaseTenantSpecificViewIndexIT extends BaseHBaseManagedTimeIT { } } -private void createBaseTable(String tableName, Integer saltBuckets) throws SQLException { +private void createBaseTable(String tableName, Integer saltBuckets, boolean hasStringTenantId) throws SQLException { Connection conn = DriverManager.getConnection(getUrl()); -String ddl = CREATE TABLE + tableName + (t_id VARCHAR NOT NULL,\n + +String tenantIdType = hasStringTenantId ? VARCHAR : BIGINT; +
phoenix git commit: PHOENIX-978: allow views to extend parent's PK
Repository: phoenix Updated Branches: refs/heads/master d02b36109 - d6044944b PHOENIX-978: allow views to extend parent's PK Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/d6044944 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d6044944 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d6044944 Branch: refs/heads/master Commit: d6044944b7b1f4981a897c1c7626614659a972c7 Parents: d02b361 Author: Eli Levine elilev...@apache.org Authored: Mon Jun 29 10:37:48 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Mon Jun 29 10:39:17 2015 -0700 -- .../end2end/TenantSpecificTablesDDLIT.java | 22 + .../java/org/apache/phoenix/end2end/ViewIT.java | 96 .../phoenix/exception/SQLExceptionCode.java | 2 - .../apache/phoenix/schema/MetaDataClient.java | 21 + 4 files changed, 101 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/d6044944/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java index e1a1970..bf86818 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java @@ -17,9 +17,7 @@ */ package org.apache.phoenix.end2end; -import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_DEFINE_PK_FOR_VIEW; import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_DROP_PK; -import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_MODIFY_VIEW_PK; import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_MUTATE_TABLE; import static org.apache.phoenix.exception.SQLExceptionCode.TABLE_UNDEFINED; import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.KEY_SEQ; @@ -158,16 +156,10 @@ public class TenantSpecificTablesDDLIT extends BaseTenantSpecificTablesIT { } @Test -public void testTenantSpecificTableCannotDeclarePK() throws SQLException { -try { +public void testTenantSpecificTableCanDeclarePK() throws SQLException { createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, CREATE VIEW TENANT_TABLE2 ( \n + tenant_col VARCHAR PRIMARY KEY) AS SELECT *\n + FROM PARENT_TABLE, null, nextTimestamp()); -fail(); -} -catch (SQLException expected) { -assertEquals(CANNOT_DEFINE_PK_FOR_VIEW.getErrorCode(), expected.getErrorCode()); -} } @Test(expected=ColumnAlreadyExistsException.class) @@ -259,20 +251,12 @@ public class TenantSpecificTablesDDLIT extends BaseTenantSpecificTablesIT { } @Test -public void testMutationOfPKInTenantTablesNotAllowed() throws Exception { +public void testDropOfPKInTenantTablesNotAllowed() throws Exception { Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(nextTimestamp())); Connection conn = DriverManager.getConnection(PHOENIX_JDBC_TENANT_SPECIFIC_URL, props); try { -try { -conn.createStatement().execute(alter table + TENANT_TABLE_NAME + add new_tenant_pk char(1) primary key); -fail(); -} -catch (SQLException expected) { -assertEquals(CANNOT_MODIFY_VIEW_PK.getErrorCode(), expected.getErrorCode()); -} - -// try removing a non-PK col +// try removing a PK col try { conn.createStatement().execute(alter table + TENANT_TABLE_NAME + drop column id); fail(); http://git-wip-us.apache.org/repos/asf/phoenix/blob/d6044944/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java index fb58a8f..db38ab3 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java @@ -17,8 +17,11 @@ */ package org.apache.phoenix.end2end; +import static com.google.common.collect.Lists.newArrayListWithExpectedSize; +import static org.apache.phoenix.exception.SQLExceptionCode.NOT_NULLABLE_COLUMN_IN_ROW_KEY; import static org.apache.phoenix.util.TestUtil.analyzeTable; import
phoenix git commit: PHOENIX-978: allow views to extend parent's PK
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.0 03455aa70 - a3a96cda2 PHOENIX-978: allow views to extend parent's PK Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/a3a96cda Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/a3a96cda Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/a3a96cda Branch: refs/heads/4.x-HBase-1.0 Commit: a3a96cda25ee5b81b7fcc84d3832657ecb253706 Parents: 03455aa Author: Eli Levine elilev...@apache.org Authored: Mon Jun 29 14:48:53 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Mon Jun 29 14:48:53 2015 -0700 -- .../end2end/TenantSpecificTablesDDLIT.java | 22 + .../java/org/apache/phoenix/end2end/ViewIT.java | 96 .../phoenix/exception/SQLExceptionCode.java | 2 - .../apache/phoenix/schema/MetaDataClient.java | 21 + 4 files changed, 101 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/a3a96cda/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java index e1a1970..bf86818 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java @@ -17,9 +17,7 @@ */ package org.apache.phoenix.end2end; -import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_DEFINE_PK_FOR_VIEW; import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_DROP_PK; -import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_MODIFY_VIEW_PK; import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_MUTATE_TABLE; import static org.apache.phoenix.exception.SQLExceptionCode.TABLE_UNDEFINED; import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.KEY_SEQ; @@ -158,16 +156,10 @@ public class TenantSpecificTablesDDLIT extends BaseTenantSpecificTablesIT { } @Test -public void testTenantSpecificTableCannotDeclarePK() throws SQLException { -try { +public void testTenantSpecificTableCanDeclarePK() throws SQLException { createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, CREATE VIEW TENANT_TABLE2 ( \n + tenant_col VARCHAR PRIMARY KEY) AS SELECT *\n + FROM PARENT_TABLE, null, nextTimestamp()); -fail(); -} -catch (SQLException expected) { -assertEquals(CANNOT_DEFINE_PK_FOR_VIEW.getErrorCode(), expected.getErrorCode()); -} } @Test(expected=ColumnAlreadyExistsException.class) @@ -259,20 +251,12 @@ public class TenantSpecificTablesDDLIT extends BaseTenantSpecificTablesIT { } @Test -public void testMutationOfPKInTenantTablesNotAllowed() throws Exception { +public void testDropOfPKInTenantTablesNotAllowed() throws Exception { Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(nextTimestamp())); Connection conn = DriverManager.getConnection(PHOENIX_JDBC_TENANT_SPECIFIC_URL, props); try { -try { -conn.createStatement().execute(alter table + TENANT_TABLE_NAME + add new_tenant_pk char(1) primary key); -fail(); -} -catch (SQLException expected) { -assertEquals(CANNOT_MODIFY_VIEW_PK.getErrorCode(), expected.getErrorCode()); -} - -// try removing a non-PK col +// try removing a PK col try { conn.createStatement().execute(alter table + TENANT_TABLE_NAME + drop column id); fail(); http://git-wip-us.apache.org/repos/asf/phoenix/blob/a3a96cda/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java index fb58a8f..db38ab3 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java @@ -17,8 +17,11 @@ */ package org.apache.phoenix.end2end; +import static com.google.common.collect.Lists.newArrayListWithExpectedSize; +import static org.apache.phoenix.exception.SQLExceptionCode.NOT_NULLABLE_COLUMN_IN_ROW_KEY; import static
phoenix git commit: PHOENIX-978: allow views to extend parent's PK
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 3b741bd7c - 4b7f31909 PHOENIX-978: allow views to extend parent's PK Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/4b7f3190 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/4b7f3190 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/4b7f3190 Branch: refs/heads/4.x-HBase-0.98 Commit: 4b7f31909be9f0385ff2feecb0f0f6d246339e19 Parents: 3b741bd Author: Eli Levine elilev...@apache.org Authored: Mon Jun 29 13:58:09 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Mon Jun 29 13:59:08 2015 -0700 -- .../end2end/TenantSpecificTablesDDLIT.java | 22 + .../java/org/apache/phoenix/end2end/ViewIT.java | 96 .../phoenix/exception/SQLExceptionCode.java | 2 - .../apache/phoenix/schema/MetaDataClient.java | 21 + 4 files changed, 101 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/4b7f3190/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java index e1a1970..bf86818 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java @@ -17,9 +17,7 @@ */ package org.apache.phoenix.end2end; -import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_DEFINE_PK_FOR_VIEW; import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_DROP_PK; -import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_MODIFY_VIEW_PK; import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_MUTATE_TABLE; import static org.apache.phoenix.exception.SQLExceptionCode.TABLE_UNDEFINED; import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.KEY_SEQ; @@ -158,16 +156,10 @@ public class TenantSpecificTablesDDLIT extends BaseTenantSpecificTablesIT { } @Test -public void testTenantSpecificTableCannotDeclarePK() throws SQLException { -try { +public void testTenantSpecificTableCanDeclarePK() throws SQLException { createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, CREATE VIEW TENANT_TABLE2 ( \n + tenant_col VARCHAR PRIMARY KEY) AS SELECT *\n + FROM PARENT_TABLE, null, nextTimestamp()); -fail(); -} -catch (SQLException expected) { -assertEquals(CANNOT_DEFINE_PK_FOR_VIEW.getErrorCode(), expected.getErrorCode()); -} } @Test(expected=ColumnAlreadyExistsException.class) @@ -259,20 +251,12 @@ public class TenantSpecificTablesDDLIT extends BaseTenantSpecificTablesIT { } @Test -public void testMutationOfPKInTenantTablesNotAllowed() throws Exception { +public void testDropOfPKInTenantTablesNotAllowed() throws Exception { Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(nextTimestamp())); Connection conn = DriverManager.getConnection(PHOENIX_JDBC_TENANT_SPECIFIC_URL, props); try { -try { -conn.createStatement().execute(alter table + TENANT_TABLE_NAME + add new_tenant_pk char(1) primary key); -fail(); -} -catch (SQLException expected) { -assertEquals(CANNOT_MODIFY_VIEW_PK.getErrorCode(), expected.getErrorCode()); -} - -// try removing a non-PK col +// try removing a PK col try { conn.createStatement().execute(alter table + TENANT_TABLE_NAME + drop column id); fail(); http://git-wip-us.apache.org/repos/asf/phoenix/blob/4b7f3190/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java index fb58a8f..db38ab3 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java @@ -17,8 +17,11 @@ */ package org.apache.phoenix.end2end; +import static com.google.common.collect.Lists.newArrayListWithExpectedSize; +import static org.apache.phoenix.exception.SQLExceptionCode.NOT_NULLABLE_COLUMN_IN_ROW_KEY; import static
phoenix git commit: PHOENIX-978: allow views to extend parent's PK
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.1 b0786f5d1 - 9db70f563 PHOENIX-978: allow views to extend parent's PK Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/9db70f56 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/9db70f56 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/9db70f56 Branch: refs/heads/4.x-HBase-1.1 Commit: 9db70f56326d380857bf71b4be82d29276920a82 Parents: b0786f5 Author: Eli Levine elilev...@apache.org Authored: Mon Jun 29 16:54:37 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Mon Jun 29 16:54:37 2015 -0700 -- .../end2end/TenantSpecificTablesDDLIT.java | 23 + .../java/org/apache/phoenix/end2end/ViewIT.java | 96 .../phoenix/exception/SQLExceptionCode.java | 2 - .../apache/phoenix/schema/MetaDataClient.java | 21 + 4 files changed, 102 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/9db70f56/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java index a7c7291..88f91e2 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java @@ -17,9 +17,7 @@ */ package org.apache.phoenix.end2end; -import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_DEFINE_PK_FOR_VIEW; import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_DROP_PK; -import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_MODIFY_VIEW_PK; import static org.apache.phoenix.exception.SQLExceptionCode.CANNOT_MUTATE_TABLE; import static org.apache.phoenix.exception.SQLExceptionCode.TABLE_UNDEFINED; import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.KEY_SEQ; @@ -158,16 +156,10 @@ public class TenantSpecificTablesDDLIT extends BaseTenantSpecificTablesIT { } @Test -public void testTenantSpecificTableCannotDeclarePK() throws SQLException { -try { -createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, CREATE VIEW TENANT_TABLE2 ( \n + +public void testTenantSpecificTableCanDeclarePK() throws SQLException { +createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, CREATE VIEW TENANT_TABLE2 ( \n + tenant_col VARCHAR PRIMARY KEY) AS SELECT *\n + FROM PARENT_TABLE, null, nextTimestamp()); -fail(); -} -catch (SQLException expected) { -assertEquals(CANNOT_DEFINE_PK_FOR_VIEW.getErrorCode(), expected.getErrorCode()); -} } @Test(expected=ColumnAlreadyExistsException.class) @@ -259,19 +251,12 @@ public class TenantSpecificTablesDDLIT extends BaseTenantSpecificTablesIT { } @Test -public void testMutationOfPKInTenantTablesNotAllowed() throws Exception { +public void testDropOfPKInTenantTablesNotAllowed() throws Exception { Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(nextTimestamp())); Connection conn = DriverManager.getConnection(PHOENIX_JDBC_TENANT_SPECIFIC_URL, props); try { -try { -conn.createStatement().execute(alter table + TENANT_TABLE_NAME + add new_tenant_pk char(1) primary key); -fail(); -} -catch (SQLException expected) { -assertEquals(CANNOT_MODIFY_VIEW_PK.getErrorCode(), expected.getErrorCode()); -} - +// try removing a PK col try { conn.createStatement().execute(alter table + TENANT_TABLE_NAME + drop column id); fail(); http://git-wip-us.apache.org/repos/asf/phoenix/blob/9db70f56/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java index fb58a8f..db38ab3 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java @@ -17,8 +17,11 @@ */ package org.apache.phoenix.end2end; +import static com.google.common.collect.Lists.newArrayListWithExpectedSize; +import static org.apache.phoenix.exception.SQLExceptionCode.NOT_NULLABLE_COLUMN_IN_ROW_KEY; import
[4/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/d01abb54 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d01abb54 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d01abb54 Branch: refs/heads/4.x-HBase-1.0 Commit: d01abb542d930ec4defced8b2ece133b5ef83857 Parents: b202817 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:41:08 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:08:36 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 415 +-- .../apache/phoenix/pig/util/TypeUtilTest.java | 52 +++ 2 files changed, 251 insertions(+), 216 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/d01abb54/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index bdee3a4..6549445 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,19 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * License); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE + * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by + * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. */ package org.apache.phoenix.pig.util; @@ -29,11 +21,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.phoenix.pig.writable.PhoenixPigDBWritable; import org.apache.phoenix.schema.types.PBinary; -import org.apache.phoenix.schema.types.PChar; -import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PBoolean; +import org.apache.phoenix.schema.types.PChar; import org.apache.phoenix.schema.types.PDataType; import org.apache.phoenix.schema.types.PDate; +import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PDouble; import org.apache.phoenix.schema.types.PFloat; import org.apache.phoenix.schema.types.PInteger; @@ -56,7 +48,6 @@ import org.apache.phoenix.schema.types.PVarchar; import org.apache.pig.PigException; import org.apache.pig.ResourceSchema.ResourceFieldSchema; import org.apache.pig.backend.hadoop.hbase.HBaseBinaryConverter; -import org.apache.pig.builtin.Utf8StorageConverter; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.DataType; import org.apache.pig.data.Tuple; @@ -68,258 +59,250 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; public final class TypeUtil { - + private static final Log LOG = LogFactory.getLog(TypeUtil.class); -private static final HBaseBinaryConverter binaryConverter = new HBaseBinaryConverter (); - private static final ImmutableMapPDataType,Byte phoenixTypeToPigDataType = init(); - - private TypeUtil(){ - } - - /** -* A map of Phoenix to Pig data types. -* @return -*/ - private static ImmutableMapPDataType, Byte init() { -final ImmutableMap.BuilderPDataType,Byte builder = new BuilderPDataType,Byte
[3/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/5ea65c85 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5ea65c85 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5ea65c85 Branch: refs/heads/4.x-HBase-1.1 Commit: 5ea65c856c817aa10cf31c3d6949213e9f0270fd Parents: 05b1b8b Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:41:08 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:09:57 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 415 +-- .../apache/phoenix/pig/util/TypeUtilTest.java | 52 +++ 2 files changed, 251 insertions(+), 216 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/5ea65c85/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index bdee3a4..6549445 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,19 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * License); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE + * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by + * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. */ package org.apache.phoenix.pig.util; @@ -29,11 +21,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.phoenix.pig.writable.PhoenixPigDBWritable; import org.apache.phoenix.schema.types.PBinary; -import org.apache.phoenix.schema.types.PChar; -import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PBoolean; +import org.apache.phoenix.schema.types.PChar; import org.apache.phoenix.schema.types.PDataType; import org.apache.phoenix.schema.types.PDate; +import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PDouble; import org.apache.phoenix.schema.types.PFloat; import org.apache.phoenix.schema.types.PInteger; @@ -56,7 +48,6 @@ import org.apache.phoenix.schema.types.PVarchar; import org.apache.pig.PigException; import org.apache.pig.ResourceSchema.ResourceFieldSchema; import org.apache.pig.backend.hadoop.hbase.HBaseBinaryConverter; -import org.apache.pig.builtin.Utf8StorageConverter; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.DataType; import org.apache.pig.data.Tuple; @@ -68,258 +59,250 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; public final class TypeUtil { - + private static final Log LOG = LogFactory.getLog(TypeUtil.class); -private static final HBaseBinaryConverter binaryConverter = new HBaseBinaryConverter (); - private static final ImmutableMapPDataType,Byte phoenixTypeToPigDataType = init(); - - private TypeUtil(){ - } - - /** -* A map of Phoenix to Pig data types. -* @return -*/ - private static ImmutableMapPDataType, Byte init() { -final ImmutableMap.BuilderPDataType,Byte builder = new BuilderPDataType,Byte
[2/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/9a0b29f7 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/9a0b29f7 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/9a0b29f7 Branch: refs/heads/4.x-HBase-1.0 Commit: 9a0b29f7d745c164a064bb9da446ebadae5d713e Parents: d01abb5 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:47:01 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:08:36 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 24 ++-- .../apache/phoenix/pig/util/TypeUtilTest.java | 20 2 files changed, 37 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/9a0b29f7/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6549445..c8bc9d8 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,11 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE - * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by - * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.phoenix.pig.util; http://git-wip-us.apache.org/repos/asf/phoenix/blob/9a0b29f7/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 25d9f48..56167f6 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.phoenix.pig.util; import static org.junit.Assert.assertEquals;
[4/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/c364dc35 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/c364dc35 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/c364dc35 Branch: refs/heads/4.x-HBase-0.98 Commit: c364dc35ba2206a336947b33ab577bb54ed536a6 Parents: b145ea3 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:41:08 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:06:25 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 415 +-- .../apache/phoenix/pig/util/TypeUtilTest.java | 52 +++ 2 files changed, 251 insertions(+), 216 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/c364dc35/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index bdee3a4..6549445 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,19 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * License); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE + * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by + * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. */ package org.apache.phoenix.pig.util; @@ -29,11 +21,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.phoenix.pig.writable.PhoenixPigDBWritable; import org.apache.phoenix.schema.types.PBinary; -import org.apache.phoenix.schema.types.PChar; -import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PBoolean; +import org.apache.phoenix.schema.types.PChar; import org.apache.phoenix.schema.types.PDataType; import org.apache.phoenix.schema.types.PDate; +import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PDouble; import org.apache.phoenix.schema.types.PFloat; import org.apache.phoenix.schema.types.PInteger; @@ -56,7 +48,6 @@ import org.apache.phoenix.schema.types.PVarchar; import org.apache.pig.PigException; import org.apache.pig.ResourceSchema.ResourceFieldSchema; import org.apache.pig.backend.hadoop.hbase.HBaseBinaryConverter; -import org.apache.pig.builtin.Utf8StorageConverter; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.DataType; import org.apache.pig.data.Tuple; @@ -68,258 +59,250 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; public final class TypeUtil { - + private static final Log LOG = LogFactory.getLog(TypeUtil.class); -private static final HBaseBinaryConverter binaryConverter = new HBaseBinaryConverter (); - private static final ImmutableMapPDataType,Byte phoenixTypeToPigDataType = init(); - - private TypeUtil(){ - } - - /** -* A map of Phoenix to Pig data types. -* @return -*/ - private static ImmutableMapPDataType, Byte init() { -final ImmutableMap.BuilderPDataType,Byte builder = new BuilderPDataType,Byte
[2/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/8390baa7 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/8390baa7 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/8390baa7 Branch: refs/heads/4.x-HBase-0.98 Commit: 8390baa7d73008a4aee662b381a2fbecd9d84b00 Parents: c364dc3 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:47:01 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:06:25 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 24 ++-- .../apache/phoenix/pig/util/TypeUtilTest.java | 20 2 files changed, 37 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/8390baa7/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6549445..c8bc9d8 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,11 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE - * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by - * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.phoenix.pig.util; http://git-wip-us.apache.org/repos/asf/phoenix/blob/8390baa7/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 25d9f48..56167f6 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.phoenix.pig.util; import static org.junit.Assert.assertEquals;
[3/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/2ca6847f Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/2ca6847f Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/2ca6847f Branch: refs/heads/4.x-HBase-0.98 Commit: 2ca6847ffdaca8d8203ea05b66407b7c7177c6d5 Parents: 8390baa Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:48:30 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:06:25 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 8 +++- .../test/java/org/apache/phoenix/pig/util/TypeUtilTest.java | 8 +++- 2 files changed, 6 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/2ca6847f/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index c8bc9d8..6e32fb5 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and http://git-wip-us.apache.org/repos/asf/phoenix/blob/2ca6847f/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 56167f6..0b44d2b 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and
[1/4] phoenix git commit: minor changes based on jesses feedback
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 b145ea3ab - 7e25b6915 minor changes based on jesses feedback Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/7e25b691 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/7e25b691 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/7e25b691 Branch: refs/heads/4.x-HBase-0.98 Commit: 7e25b69156d9f5615893d5e5c1bfb714f3547d0c Parents: 2ca6847 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon Jun 15 16:18:47 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:06:25 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/7e25b691/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6e32fb5..5820ec6 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -76,9 +76,7 @@ public final class TypeUtil { private TypeUtil() {} /** - * A map of Phoenix to Pig data types. - * - * @return + * @return map of Phoenix to Pig data types. */ private static ImmutableMapPDataType, Byte init() { final ImmutableMap.BuilderPDataType, Byte builder = new BuilderPDataType, Byte(); @@ -160,7 +158,8 @@ public final class TypeUtil { /** * This method encodes a value with Phoenix data type. It begins with checking whether an object is BINARY and makes - * a call to {@link #castBytes(Object, PDataType)} to convery bytes to targetPhoenixType + * a call to {@link #castBytes(Object, PDataType)} to convert bytes to targetPhoenixType. It returns a {@link RuntimeException} + * when object can not be coerced. * * @param o * @param targetPhoenixType
[3/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/9c86b0ae Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/9c86b0ae Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/9c86b0ae Branch: refs/heads/4.4-HBase-0.98 Commit: 9c86b0ae8db3be6539e4fb5576661061127afa3e Parents: 663aa48 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:48:30 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:11:36 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 8 +++- .../test/java/org/apache/phoenix/pig/util/TypeUtilTest.java | 8 +++- 2 files changed, 6 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/9c86b0ae/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index c8bc9d8..6e32fb5 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and http://git-wip-us.apache.org/repos/asf/phoenix/blob/9c86b0ae/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 56167f6..0b44d2b 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and
[2/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/663aa483 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/663aa483 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/663aa483 Branch: refs/heads/4.4-HBase-0.98 Commit: 663aa483aa602a35b6ce48d892208576390019d9 Parents: 2673d09 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:47:01 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:11:36 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 24 ++-- .../apache/phoenix/pig/util/TypeUtilTest.java | 20 2 files changed, 37 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/663aa483/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6549445..c8bc9d8 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,11 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE - * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by - * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.phoenix.pig.util; http://git-wip-us.apache.org/repos/asf/phoenix/blob/663aa483/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 25d9f48..56167f6 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.phoenix.pig.util; import static org.junit.Assert.assertEquals;
[1/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.1 05b1b8b13 - fbd2922f2 PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/62250475 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/62250475 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/62250475 Branch: refs/heads/4.x-HBase-1.1 Commit: 62250475e741a72d8ba17e66593d5fdcebac2fa6 Parents: e83dc20 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:48:30 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:09:57 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 8 +++- .../test/java/org/apache/phoenix/pig/util/TypeUtilTest.java | 8 +++- 2 files changed, 6 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/62250475/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index c8bc9d8..6e32fb5 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and http://git-wip-us.apache.org/repos/asf/phoenix/blob/62250475/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 56167f6..0b44d2b 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and
[3/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/063f548b Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/063f548b Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/063f548b Branch: refs/heads/4.x-HBase-1.0 Commit: 063f548b8a3ae03f4a60137f81cb6f7cc41ae974 Parents: 9a0b29f Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:48:30 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:08:36 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 8 +++- .../test/java/org/apache/phoenix/pig/util/TypeUtilTest.java | 8 +++- 2 files changed, 6 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/063f548b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index c8bc9d8..6e32fb5 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and http://git-wip-us.apache.org/repos/asf/phoenix/blob/063f548b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 56167f6..0b44d2b 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and
[3/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/c9dd4ce8 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/c9dd4ce8 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/c9dd4ce8 Branch: refs/heads/4.4-HBase-1.1 Commit: c9dd4ce8919399c697ee121735620c531a107776 Parents: 5600c0e Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:48:30 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:16:20 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 8 +++- .../test/java/org/apache/phoenix/pig/util/TypeUtilTest.java | 8 +++- 2 files changed, 6 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/c9dd4ce8/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index c8bc9d8..6e32fb5 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and http://git-wip-us.apache.org/repos/asf/phoenix/blob/c9dd4ce8/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 56167f6..0b44d2b 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and
[2/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/5600c0e5 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5600c0e5 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5600c0e5 Branch: refs/heads/4.4-HBase-1.1 Commit: 5600c0e5e1618d95c5a17f0e7809707cf479e4c7 Parents: e7f4afe Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:47:01 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:16:20 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 24 ++-- .../apache/phoenix/pig/util/TypeUtilTest.java | 20 2 files changed, 37 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/5600c0e5/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6549445..c8bc9d8 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,11 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE - * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by - * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.phoenix.pig.util; http://git-wip-us.apache.org/repos/asf/phoenix/blob/5600c0e5/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 25d9f48..56167f6 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.phoenix.pig.util; import static org.junit.Assert.assertEquals;
[4/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/e7f4afe6 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/e7f4afe6 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/e7f4afe6 Branch: refs/heads/4.4-HBase-1.1 Commit: e7f4afe6c2f7eb587c4ae845996b6c7cc553e7da Parents: a7f1326 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:41:08 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:16:20 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 415 +-- .../apache/phoenix/pig/util/TypeUtilTest.java | 52 +++ 2 files changed, 251 insertions(+), 216 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/e7f4afe6/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index bdee3a4..6549445 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,19 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * License); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE + * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by + * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. */ package org.apache.phoenix.pig.util; @@ -29,11 +21,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.phoenix.pig.writable.PhoenixPigDBWritable; import org.apache.phoenix.schema.types.PBinary; -import org.apache.phoenix.schema.types.PChar; -import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PBoolean; +import org.apache.phoenix.schema.types.PChar; import org.apache.phoenix.schema.types.PDataType; import org.apache.phoenix.schema.types.PDate; +import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PDouble; import org.apache.phoenix.schema.types.PFloat; import org.apache.phoenix.schema.types.PInteger; @@ -56,7 +48,6 @@ import org.apache.phoenix.schema.types.PVarchar; import org.apache.pig.PigException; import org.apache.pig.ResourceSchema.ResourceFieldSchema; import org.apache.pig.backend.hadoop.hbase.HBaseBinaryConverter; -import org.apache.pig.builtin.Utf8StorageConverter; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.DataType; import org.apache.pig.data.Tuple; @@ -68,258 +59,250 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; public final class TypeUtil { - + private static final Log LOG = LogFactory.getLog(TypeUtil.class); -private static final HBaseBinaryConverter binaryConverter = new HBaseBinaryConverter (); - private static final ImmutableMapPDataType,Byte phoenixTypeToPigDataType = init(); - - private TypeUtil(){ - } - - /** -* A map of Phoenix to Pig data types. -* @return -*/ - private static ImmutableMapPDataType, Byte init() { -final ImmutableMap.BuilderPDataType,Byte builder = new BuilderPDataType,Byte
[1/4] phoenix git commit: minor changes based on jesses feedback
Repository: phoenix Updated Branches: refs/heads/4.4-HBase-1.1 a7f132650 - bd524246b minor changes based on jesses feedback Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/bd524246 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/bd524246 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/bd524246 Branch: refs/heads/4.4-HBase-1.1 Commit: bd524246bf415b01a3320c9260b6b9539eee25a2 Parents: c9dd4ce Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon Jun 15 16:18:47 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:16:20 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/bd524246/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6e32fb5..5820ec6 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -76,9 +76,7 @@ public final class TypeUtil { private TypeUtil() {} /** - * A map of Phoenix to Pig data types. - * - * @return + * @return map of Phoenix to Pig data types. */ private static ImmutableMapPDataType, Byte init() { final ImmutableMap.BuilderPDataType, Byte builder = new BuilderPDataType, Byte(); @@ -160,7 +158,8 @@ public final class TypeUtil { /** * This method encodes a value with Phoenix data type. It begins with checking whether an object is BINARY and makes - * a call to {@link #castBytes(Object, PDataType)} to convery bytes to targetPhoenixType + * a call to {@link #castBytes(Object, PDataType)} to convert bytes to targetPhoenixType. It returns a {@link RuntimeException} + * when object can not be coerced. * * @param o * @param targetPhoenixType
[1/4] phoenix git commit: minor changes based on jesses feedback
Repository: phoenix Updated Branches: refs/heads/4.4-HBase-0.98 23d90c19c - 1a620a7f2 minor changes based on jesses feedback Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/1a620a7f Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/1a620a7f Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/1a620a7f Branch: refs/heads/4.4-HBase-0.98 Commit: 1a620a7f29754678d75b9e4430b835c281fcdda3 Parents: 9c86b0a Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon Jun 15 16:18:47 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:11:36 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/1a620a7f/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6e32fb5..5820ec6 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -76,9 +76,7 @@ public final class TypeUtil { private TypeUtil() {} /** - * A map of Phoenix to Pig data types. - * - * @return + * @return map of Phoenix to Pig data types. */ private static ImmutableMapPDataType, Byte init() { final ImmutableMap.BuilderPDataType, Byte builder = new BuilderPDataType, Byte(); @@ -160,7 +158,8 @@ public final class TypeUtil { /** * This method encodes a value with Phoenix data type. It begins with checking whether an object is BINARY and makes - * a call to {@link #castBytes(Object, PDataType)} to convery bytes to targetPhoenixType + * a call to {@link #castBytes(Object, PDataType)} to convert bytes to targetPhoenixType. It returns a {@link RuntimeException} + * when object can not be coerced. * * @param o * @param targetPhoenixType
[4/4] phoenix git commit: minor changes based on jesses feedback
minor changes based on jesses feedback Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/fbd2922f Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/fbd2922f Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/fbd2922f Branch: refs/heads/4.x-HBase-1.1 Commit: fbd2922f286fd4c1658281b62cc3f414c618106f Parents: 6225047 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon Jun 15 16:18:47 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:09:58 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/fbd2922f/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6e32fb5..5820ec6 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -76,9 +76,7 @@ public final class TypeUtil { private TypeUtil() {} /** - * A map of Phoenix to Pig data types. - * - * @return + * @return map of Phoenix to Pig data types. */ private static ImmutableMapPDataType, Byte init() { final ImmutableMap.BuilderPDataType, Byte builder = new BuilderPDataType, Byte(); @@ -160,7 +158,8 @@ public final class TypeUtil { /** * This method encodes a value with Phoenix data type. It begins with checking whether an object is BINARY and makes - * a call to {@link #castBytes(Object, PDataType)} to convery bytes to targetPhoenixType + * a call to {@link #castBytes(Object, PDataType)} to convert bytes to targetPhoenixType. It returns a {@link RuntimeException} + * when object can not be coerced. * * @param o * @param targetPhoenixType
[4/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/2673d095 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/2673d095 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/2673d095 Branch: refs/heads/4.4-HBase-0.98 Commit: 2673d0957eb9e9fd7226e2115c918fad951b9c9c Parents: 23d90c1 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:41:08 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:11:36 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 415 +-- .../apache/phoenix/pig/util/TypeUtilTest.java | 52 +++ 2 files changed, 251 insertions(+), 216 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/2673d095/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index bdee3a4..6549445 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,19 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * License); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE + * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by + * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. */ package org.apache.phoenix.pig.util; @@ -29,11 +21,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.phoenix.pig.writable.PhoenixPigDBWritable; import org.apache.phoenix.schema.types.PBinary; -import org.apache.phoenix.schema.types.PChar; -import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PBoolean; +import org.apache.phoenix.schema.types.PChar; import org.apache.phoenix.schema.types.PDataType; import org.apache.phoenix.schema.types.PDate; +import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PDouble; import org.apache.phoenix.schema.types.PFloat; import org.apache.phoenix.schema.types.PInteger; @@ -56,7 +48,6 @@ import org.apache.phoenix.schema.types.PVarchar; import org.apache.pig.PigException; import org.apache.pig.ResourceSchema.ResourceFieldSchema; import org.apache.pig.backend.hadoop.hbase.HBaseBinaryConverter; -import org.apache.pig.builtin.Utf8StorageConverter; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.DataType; import org.apache.pig.data.Tuple; @@ -68,258 +59,250 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; public final class TypeUtil { - + private static final Log LOG = LogFactory.getLog(TypeUtil.class); -private static final HBaseBinaryConverter binaryConverter = new HBaseBinaryConverter (); - private static final ImmutableMapPDataType,Byte phoenixTypeToPigDataType = init(); - - private TypeUtil(){ - } - - /** -* A map of Phoenix to Pig data types. -* @return -*/ - private static ImmutableMapPDataType, Byte init() { -final ImmutableMap.BuilderPDataType,Byte builder = new BuilderPDataType,Byte
[4/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/a7080d16 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/a7080d16 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/a7080d16 Branch: refs/heads/4.4-HBase-1.0 Commit: a7080d1630238b67e8e306becf705aef3d727155 Parents: daad66c Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:41:08 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:13:15 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 415 +-- .../apache/phoenix/pig/util/TypeUtilTest.java | 52 +++ 2 files changed, 251 insertions(+), 216 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/a7080d16/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index bdee3a4..6549445 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,19 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * License); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE + * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by + * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. */ package org.apache.phoenix.pig.util; @@ -29,11 +21,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.phoenix.pig.writable.PhoenixPigDBWritable; import org.apache.phoenix.schema.types.PBinary; -import org.apache.phoenix.schema.types.PChar; -import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PBoolean; +import org.apache.phoenix.schema.types.PChar; import org.apache.phoenix.schema.types.PDataType; import org.apache.phoenix.schema.types.PDate; +import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PDouble; import org.apache.phoenix.schema.types.PFloat; import org.apache.phoenix.schema.types.PInteger; @@ -56,7 +48,6 @@ import org.apache.phoenix.schema.types.PVarchar; import org.apache.pig.PigException; import org.apache.pig.ResourceSchema.ResourceFieldSchema; import org.apache.pig.backend.hadoop.hbase.HBaseBinaryConverter; -import org.apache.pig.builtin.Utf8StorageConverter; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.DataType; import org.apache.pig.data.Tuple; @@ -68,258 +59,250 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; public final class TypeUtil { - + private static final Log LOG = LogFactory.getLog(TypeUtil.class); -private static final HBaseBinaryConverter binaryConverter = new HBaseBinaryConverter (); - private static final ImmutableMapPDataType,Byte phoenixTypeToPigDataType = init(); - - private TypeUtil(){ - } - - /** -* A map of Phoenix to Pig data types. -* @return -*/ - private static ImmutableMapPDataType, Byte init() { -final ImmutableMap.BuilderPDataType,Byte builder = new BuilderPDataType,Byte
[3/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/95e30719 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/95e30719 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/95e30719 Branch: refs/heads/4.4-HBase-1.0 Commit: 95e30719696a296f39abc8bdc20f1163714b3704 Parents: 00f2e1b Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:48:30 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:13:15 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 8 +++- .../test/java/org/apache/phoenix/pig/util/TypeUtilTest.java | 8 +++- 2 files changed, 6 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/95e30719/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index c8bc9d8..6e32fb5 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and http://git-wip-us.apache.org/repos/asf/phoenix/blob/95e30719/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 56167f6..0b44d2b 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and
[2/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/00f2e1b8 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/00f2e1b8 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/00f2e1b8 Branch: refs/heads/4.4-HBase-1.0 Commit: 00f2e1b8ecbd0cd5eec448e83311e4da4888003b Parents: a7080d1 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:47:01 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:13:15 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 24 ++-- .../apache/phoenix/pig/util/TypeUtilTest.java | 20 2 files changed, 37 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/00f2e1b8/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6549445..c8bc9d8 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,11 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE - * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by - * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.phoenix.pig.util; http://git-wip-us.apache.org/repos/asf/phoenix/blob/00f2e1b8/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 25d9f48..56167f6 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.phoenix.pig.util; import static org.junit.Assert.assertEquals;
[1/4] phoenix git commit: minor changes based on jesses feedback
Repository: phoenix Updated Branches: refs/heads/4.4-HBase-1.0 daad66ce6 - c8ae7aa0c minor changes based on jesses feedback Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/c8ae7aa0 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/c8ae7aa0 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/c8ae7aa0 Branch: refs/heads/4.4-HBase-1.0 Commit: c8ae7aa0ca0fb6fdcc31c740605fa857f13c6a2b Parents: 95e3071 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon Jun 15 16:18:47 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Jun 17 13:13:15 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/c8ae7aa0/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6e32fb5..5820ec6 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -76,9 +76,7 @@ public final class TypeUtil { private TypeUtil() {} /** - * A map of Phoenix to Pig data types. - * - * @return + * @return map of Phoenix to Pig data types. */ private static ImmutableMapPDataType, Byte init() { final ImmutableMap.BuilderPDataType, Byte builder = new BuilderPDataType, Byte(); @@ -160,7 +158,8 @@ public final class TypeUtil { /** * This method encodes a value with Phoenix data type. It begins with checking whether an object is BINARY and makes - * a call to {@link #castBytes(Object, PDataType)} to convery bytes to targetPhoenixType + * a call to {@link #castBytes(Object, PDataType)} to convert bytes to targetPhoenixType. It returns a {@link RuntimeException} + * when object can not be coerced. * * @param o * @param targetPhoenixType
[3/4] phoenix git commit: minor changes based on jesses feedback
minor changes based on jesses feedback Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/d1f7dede Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d1f7dede Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d1f7dede Branch: refs/heads/master Commit: d1f7dedeccbb0befce071cb87efd38290271039a Parents: a4aa780 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon Jun 15 16:18:47 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Mon Jun 15 18:17:45 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/d1f7dede/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6e32fb5..5820ec6 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -76,9 +76,7 @@ public final class TypeUtil { private TypeUtil() {} /** - * A map of Phoenix to Pig data types. - * - * @return + * @return map of Phoenix to Pig data types. */ private static ImmutableMapPDataType, Byte init() { final ImmutableMap.BuilderPDataType, Byte builder = new BuilderPDataType, Byte(); @@ -160,7 +158,8 @@ public final class TypeUtil { /** * This method encodes a value with Phoenix data type. It begins with checking whether an object is BINARY and makes - * a call to {@link #castBytes(Object, PDataType)} to convery bytes to targetPhoenixType + * a call to {@link #castBytes(Object, PDataType)} to convert bytes to targetPhoenixType. It returns a {@link RuntimeException} + * when object can not be coerced. * * @param o * @param targetPhoenixType
[1/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
Repository: phoenix Updated Branches: refs/heads/master b61ef77e5 - d1f7dedec PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/8076126a Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/8076126a Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/8076126a Branch: refs/heads/master Commit: 8076126a741a0cf2a5839b88904fa08bfdfb6cdb Parents: b61ef77 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:41:08 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Mon Jun 15 18:17:44 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 415 +-- .../apache/phoenix/pig/util/TypeUtilTest.java | 52 +++ 2 files changed, 251 insertions(+), 216 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/8076126a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index bdee3a4..6549445 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,19 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * License); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE + * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by + * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. */ package org.apache.phoenix.pig.util; @@ -29,11 +21,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.phoenix.pig.writable.PhoenixPigDBWritable; import org.apache.phoenix.schema.types.PBinary; -import org.apache.phoenix.schema.types.PChar; -import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PBoolean; +import org.apache.phoenix.schema.types.PChar; import org.apache.phoenix.schema.types.PDataType; import org.apache.phoenix.schema.types.PDate; +import org.apache.phoenix.schema.types.PDecimal; import org.apache.phoenix.schema.types.PDouble; import org.apache.phoenix.schema.types.PFloat; import org.apache.phoenix.schema.types.PInteger; @@ -56,7 +48,6 @@ import org.apache.phoenix.schema.types.PVarchar; import org.apache.pig.PigException; import org.apache.pig.ResourceSchema.ResourceFieldSchema; import org.apache.pig.backend.hadoop.hbase.HBaseBinaryConverter; -import org.apache.pig.builtin.Utf8StorageConverter; import org.apache.pig.data.DataByteArray; import org.apache.pig.data.DataType; import org.apache.pig.data.Tuple; @@ -68,258 +59,250 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; public final class TypeUtil { - + private static final Log LOG = LogFactory.getLog(TypeUtil.class); -private static final HBaseBinaryConverter binaryConverter = new HBaseBinaryConverter (); - private static final ImmutableMapPDataType,Byte phoenixTypeToPigDataType = init(); - - private TypeUtil(){ - } - - /** -* A map of Phoenix to Pig data types. -* @return -*/ - private static ImmutableMapPDataType, Byte init() { -final
[2/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/8a0dee77 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/8a0dee77 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/8a0dee77 Branch: refs/heads/master Commit: 8a0dee77c67761c57feae31350c84304ccc44c07 Parents: 8076126 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:47:01 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Mon Jun 15 18:17:45 2015 -0700 -- .../org/apache/phoenix/pig/util/TypeUtil.java | 24 ++-- .../apache/phoenix/pig/util/TypeUtilTest.java | 20 2 files changed, 37 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/8a0dee77/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index 6549445..c8bc9d8 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,11 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE - * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by - * applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.phoenix.pig.util; http://git-wip-us.apache.org/repos/asf/phoenix/blob/8a0dee77/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 25d9f48..56167f6 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.phoenix.pig.util; import static org.junit.Assert.assertEquals;
[4/4] phoenix git commit: PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types
PHOENIX-1981 : PhoenixHBase Load and Store Funcs should handle all Pig data types Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/a4aa780c Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/a4aa780c Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/a4aa780c Branch: refs/heads/master Commit: a4aa780c78f73cf0ee5f7d5e7afefd7ab581097a Parents: 8a0dee7 Author: Prashant Kommireddi pkommire...@pkommireddi-ltm.internal.salesforce.com Authored: Mon May 18 19:48:30 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Mon Jun 15 18:17:45 2015 -0700 -- .../src/main/java/org/apache/phoenix/pig/util/TypeUtil.java | 8 +++- .../test/java/org/apache/phoenix/pig/util/TypeUtilTest.java | 8 +++- 2 files changed, 6 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/a4aa780c/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java -- diff --git a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java index c8bc9d8..6e32fb5 100644 --- a/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java +++ b/phoenix-pig/src/main/java/org/apache/phoenix/pig/util/TypeUtil.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and http://git-wip-us.apache.org/repos/asf/phoenix/blob/a4aa780c/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java -- diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java index 56167f6..0b44d2b 100644 --- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java +++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/TypeUtilTest.java @@ -1,17 +1,15 @@ /* - * Copyright 2010 The Apache Software Foundation - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information + * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance + * License); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicablelaw or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and
[1/2] phoenix git commit: PHOENIX-900 Fix failing PartialCommitIT.testDeleteFailure()
Repository: phoenix Updated Branches: refs/heads/master f54abb55c - ac2e2368e PHOENIX-900 Fix failing PartialCommitIT.testDeleteFailure() Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/f312a058 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/f312a058 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/f312a058 Branch: refs/heads/master Commit: f312a058746382ca442ee86eed7b857f5d1a1767 Parents: 67c4c45 Author: Eli Levine elilev...@apache.org Authored: Wed Apr 22 10:44:56 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Apr 22 10:44:56 2015 -0700 -- .../apache/phoenix/execute/PartialCommitIT.java | 27 1 file changed, 22 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/f312a058/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java index 550d7de..812fdba 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java @@ -33,6 +33,7 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; +import java.io.IOException; import java.sql.Connection; import java.sql.Driver; import java.sql.ResultSet; @@ -47,6 +48,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseIOException; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -268,7 +270,7 @@ public class PartialCommitIT { @Override public void prePut(ObserverContextRegionCoprocessorEnvironment c, Put put, WALEdit edit, final Durability durability) throws HBaseIOException { -if (shouldFailUpsert(c, put) || shouldFailDelete(c, put)) { +if (shouldFailUpsert(c, put)) { // throwing anything other than instances of IOException result // in this coprocessor being unloaded // DoNotRetryIOException tells HBase not to retry this mutation @@ -277,16 +279,31 @@ public class PartialCommitIT { } } -private static boolean shouldFailUpsert(ObserverContextRegionCoprocessorEnvironment c, Put put) { +@Override +public void preDelete(ObserverContextRegionCoprocessorEnvironment c, + Delete delete, WALEdit edit, Durability durability) + throws IOException { + System.out.println( c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString() + ' ' + delete + ' ' + delete.getFamilyCellMap().firstEntry().getValue().get(0).getQualifierLength()); +if (shouldFailDelete(c, delete)) { +// throwing anything other than instances of IOException result +// in this coprocessor being unloaded +// DoNotRetryIOException tells HBase not to retry this mutation +// multiple times +throw new DoNotRetryIOException(); +} +} + +private boolean shouldFailUpsert(ObserverContextRegionCoprocessorEnvironment c, Put put) { String tableName = c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString(); return TABLE_NAME_TO_FAIL.equals(tableName) Bytes.equals(ROW_TO_FAIL, put.getRow()); } -private static boolean shouldFailDelete(ObserverContextRegionCoprocessorEnvironment c, Put put) { +private boolean shouldFailDelete(ObserverContextRegionCoprocessorEnvironment c, Delete delete) { String tableName = c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString(); return TABLE_NAME_TO_FAIL.equals(tableName) - // Phoenix deletes are sent as Puts with empty values - put.getFamilyCellMap().firstEntry().getValue().get(0).getValueLength() == 0; + // Phoenix deletes are sent as Mutations with empty values + delete.getFamilyCellMap().firstEntry().getValue().get(0).getValueLength() == 0 + delete.getFamilyCellMap().firstEntry().getValue().get(0).getQualifierLength() == 0; } }
phoenix git commit: PHOENIX-900 Fix whitespaces and remove System.out from PartialCommitIT
Repository: phoenix Updated Branches: refs/heads/master ac2e2368e - 784c354af PHOENIX-900 Fix whitespaces and remove System.out from PartialCommitIT Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/784c354a Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/784c354a Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/784c354a Branch: refs/heads/master Commit: 784c354af8f21006d695cca7e175fb22be73ebd0 Parents: ac2e236 Author: Eli Levine elilev...@apache.org Authored: Wed Apr 22 11:28:04 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Apr 22 11:28:04 2015 -0700 -- .../java/org/apache/phoenix/execute/PartialCommitIT.java | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/784c354a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java index 812fdba..c8696e2 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java @@ -281,9 +281,7 @@ public class PartialCommitIT { @Override public void preDelete(ObserverContextRegionCoprocessorEnvironment c, - Delete delete, WALEdit edit, Durability durability) - throws IOException { - System.out.println( c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString() + ' ' + delete + ' ' + delete.getFamilyCellMap().firstEntry().getValue().get(0).getQualifierLength()); +Delete delete, WALEdit edit, Durability durability) throws IOException { if (shouldFailDelete(c, delete)) { // throwing anything other than instances of IOException result // in this coprocessor being unloaded @@ -301,9 +299,9 @@ public class PartialCommitIT { private boolean shouldFailDelete(ObserverContextRegionCoprocessorEnvironment c, Delete delete) { String tableName = c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString(); return TABLE_NAME_TO_FAIL.equals(tableName) - // Phoenix deletes are sent as Mutations with empty values - delete.getFamilyCellMap().firstEntry().getValue().get(0).getValueLength() == 0 - delete.getFamilyCellMap().firstEntry().getValue().get(0).getQualifierLength() == 0; +// Phoenix deletes are sent as Mutations with empty values + delete.getFamilyCellMap().firstEntry().getValue().get(0).getValueLength() == 0 + delete.getFamilyCellMap().firstEntry().getValue().get(0).getQualifierLength() == 0; } }
phoenix git commit: PHOENIX-900 Fix failing PartialCommitIT.testDeleteFailure()
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 080767878 - 4d957ee3c PHOENIX-900 Fix failing PartialCommitIT.testDeleteFailure() Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/4d957ee3 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/4d957ee3 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/4d957ee3 Branch: refs/heads/4.x-HBase-0.98 Commit: 4d957ee3c742f76a2cd6358aaecc782ce640008c Parents: 0807678 Author: Eli Levine elilev...@apache.org Authored: Wed Apr 22 11:48:35 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Apr 22 11:48:35 2015 -0700 -- .../apache/phoenix/execute/PartialCommitIT.java | 25 1 file changed, 20 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/4d957ee3/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java index 550d7de..c8696e2 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java @@ -33,6 +33,7 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; +import java.io.IOException; import java.sql.Connection; import java.sql.Driver; import java.sql.ResultSet; @@ -47,6 +48,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseIOException; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -268,7 +270,7 @@ public class PartialCommitIT { @Override public void prePut(ObserverContextRegionCoprocessorEnvironment c, Put put, WALEdit edit, final Durability durability) throws HBaseIOException { -if (shouldFailUpsert(c, put) || shouldFailDelete(c, put)) { +if (shouldFailUpsert(c, put)) { // throwing anything other than instances of IOException result // in this coprocessor being unloaded // DoNotRetryIOException tells HBase not to retry this mutation @@ -277,16 +279,29 @@ public class PartialCommitIT { } } -private static boolean shouldFailUpsert(ObserverContextRegionCoprocessorEnvironment c, Put put) { +@Override +public void preDelete(ObserverContextRegionCoprocessorEnvironment c, +Delete delete, WALEdit edit, Durability durability) throws IOException { +if (shouldFailDelete(c, delete)) { +// throwing anything other than instances of IOException result +// in this coprocessor being unloaded +// DoNotRetryIOException tells HBase not to retry this mutation +// multiple times +throw new DoNotRetryIOException(); +} +} + +private boolean shouldFailUpsert(ObserverContextRegionCoprocessorEnvironment c, Put put) { String tableName = c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString(); return TABLE_NAME_TO_FAIL.equals(tableName) Bytes.equals(ROW_TO_FAIL, put.getRow()); } -private static boolean shouldFailDelete(ObserverContextRegionCoprocessorEnvironment c, Put put) { +private boolean shouldFailDelete(ObserverContextRegionCoprocessorEnvironment c, Delete delete) { String tableName = c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString(); return TABLE_NAME_TO_FAIL.equals(tableName) - // Phoenix deletes are sent as Puts with empty values - put.getFamilyCellMap().firstEntry().getValue().get(0).getValueLength() == 0; +// Phoenix deletes are sent as Mutations with empty values + delete.getFamilyCellMap().firstEntry().getValue().get(0).getValueLength() == 0 + delete.getFamilyCellMap().firstEntry().getValue().get(0).getQualifierLength() == 0; } }
[1/2] phoenix git commit: Fix QueryMoreIT failures (Ivan Weiss)
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 c00c03700 - 3a723832c Fix QueryMoreIT failures (Ivan Weiss) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/df6f8f87 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/df6f8f87 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/df6f8f87 Branch: refs/heads/4.x-HBase-0.98 Commit: df6f8f87f8c6e9b59ca64d25ca8c12f793a4f6a1 Parents: 4d957ee Author: Eli Levine elilev...@apache.org Authored: Wed Apr 22 15:25:32 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Apr 22 15:25:32 2015 -0700 -- .../src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java| 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/df6f8f87/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java index e725376..a29cb0e 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java @@ -104,7 +104,7 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT { // assert query more for tenantId - tenantIds[0] String tenantId = tenantIds[0]; String cursorQueryId = 00TcursrqueryId; -String tableOrViewName = queryAgainstTenantSpecificView ? (\HISTORY_TABLE + _ + tenantId + \) : dataTableName; +String tableOrViewName = queryAgainstTenantSpecificView ? (HISTORY_TABLE_ + tenantId) : dataTableName; assertEquals(numRowsPerTenant, upsertSelectRecordsInCursorTableForTenant(tableOrViewName, queryAgainstTenantSpecificView, tenantId, cursorQueryId)); @@ -265,7 +265,7 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT { values[i] = rs.getObject(i + 1); } conn = getTenantSpecificConnection(tenantId); -pkIds.add(Base64.encodeBytes(PhoenixRuntime.encodeValues(conn, tableOrViewName, values, columns))); +pkIds.add(Base64.encodeBytes(PhoenixRuntime.encodeValues(conn, tableOrViewName.toUpperCase(), values, columns))); } return pkIds.toArray(new String[pkIds.size()]); } @@ -283,7 +283,7 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT { PreparedStatement stmt = conn.prepareStatement(query); int bindCounter = 1; for (int i = 0; i cursorIds.length; i++) { -Object[] pkParts = PhoenixRuntime.decodeValues(conn, tableName, Base64.decode(cursorIds[i]), columns); +Object[] pkParts = PhoenixRuntime.decodeValues(conn, tableName.toUpperCase(), Base64.decode(cursorIds[i]), columns); for (int j = 0; j pkParts.length; j++) { stmt.setObject(bindCounter++, pkParts[j]); }
phoenix git commit: PHOENIX-1682 Fix QueryMoreIT failures (Ivan Weiss)
Repository: phoenix Updated Branches: refs/heads/master f956a736b - 8daa52c47 PHOENIX-1682 Fix QueryMoreIT failures (Ivan Weiss) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/8daa52c4 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/8daa52c4 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/8daa52c4 Branch: refs/heads/master Commit: 8daa52c47fdc0301eac33235c2f7d145d103b1d0 Parents: f956a73 Author: Eli Levine elilev...@apache.org Authored: Wed Apr 22 15:32:44 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Apr 22 15:32:44 2015 -0700 -- .../src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java| 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/8daa52c4/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java index e725376..a29cb0e 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java @@ -104,7 +104,7 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT { // assert query more for tenantId - tenantIds[0] String tenantId = tenantIds[0]; String cursorQueryId = 00TcursrqueryId; -String tableOrViewName = queryAgainstTenantSpecificView ? (\HISTORY_TABLE + _ + tenantId + \) : dataTableName; +String tableOrViewName = queryAgainstTenantSpecificView ? (HISTORY_TABLE_ + tenantId) : dataTableName; assertEquals(numRowsPerTenant, upsertSelectRecordsInCursorTableForTenant(tableOrViewName, queryAgainstTenantSpecificView, tenantId, cursorQueryId)); @@ -265,7 +265,7 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT { values[i] = rs.getObject(i + 1); } conn = getTenantSpecificConnection(tenantId); -pkIds.add(Base64.encodeBytes(PhoenixRuntime.encodeValues(conn, tableOrViewName, values, columns))); +pkIds.add(Base64.encodeBytes(PhoenixRuntime.encodeValues(conn, tableOrViewName.toUpperCase(), values, columns))); } return pkIds.toArray(new String[pkIds.size()]); } @@ -283,7 +283,7 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT { PreparedStatement stmt = conn.prepareStatement(query); int bindCounter = 1; for (int i = 0; i cursorIds.length; i++) { -Object[] pkParts = PhoenixRuntime.decodeValues(conn, tableName, Base64.decode(cursorIds[i]), columns); +Object[] pkParts = PhoenixRuntime.decodeValues(conn, tableName.toUpperCase(), Base64.decode(cursorIds[i]), columns); for (int j = 0; j pkParts.length; j++) { stmt.setObject(bindCounter++, pkParts[j]); }
phoenix git commit: PHOENIX-1682 Fix QueryMoreIT failures (Ivan Weiss)
Repository: phoenix Updated Branches: refs/heads/4.3 31b03782a - ee6910dff PHOENIX-1682 Fix QueryMoreIT failures (Ivan Weiss) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/ee6910df Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ee6910df Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ee6910df Branch: refs/heads/4.3 Commit: ee6910dffad003e93f6301c2df4c7c0d2d4d4e5d Parents: 31b0378 Author: Eli Levine elilev...@apache.org Authored: Wed Apr 22 15:33:58 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Wed Apr 22 15:33:58 2015 -0700 -- .../src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java| 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/ee6910df/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java index e725376..a29cb0e 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java @@ -104,7 +104,7 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT { // assert query more for tenantId - tenantIds[0] String tenantId = tenantIds[0]; String cursorQueryId = 00TcursrqueryId; -String tableOrViewName = queryAgainstTenantSpecificView ? (\HISTORY_TABLE + _ + tenantId + \) : dataTableName; +String tableOrViewName = queryAgainstTenantSpecificView ? (HISTORY_TABLE_ + tenantId) : dataTableName; assertEquals(numRowsPerTenant, upsertSelectRecordsInCursorTableForTenant(tableOrViewName, queryAgainstTenantSpecificView, tenantId, cursorQueryId)); @@ -265,7 +265,7 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT { values[i] = rs.getObject(i + 1); } conn = getTenantSpecificConnection(tenantId); -pkIds.add(Base64.encodeBytes(PhoenixRuntime.encodeValues(conn, tableOrViewName, values, columns))); +pkIds.add(Base64.encodeBytes(PhoenixRuntime.encodeValues(conn, tableOrViewName.toUpperCase(), values, columns))); } return pkIds.toArray(new String[pkIds.size()]); } @@ -283,7 +283,7 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT { PreparedStatement stmt = conn.prepareStatement(query); int bindCounter = 1; for (int i = 0; i cursorIds.length; i++) { -Object[] pkParts = PhoenixRuntime.decodeValues(conn, tableName, Base64.decode(cursorIds[i]), columns); +Object[] pkParts = PhoenixRuntime.decodeValues(conn, tableName.toUpperCase(), Base64.decode(cursorIds[i]), columns); for (int j = 0; j pkParts.length; j++) { stmt.setObject(bindCounter++, pkParts[j]); }
phoenix git commit: PHOENIX-900 Partial results for mutations
Repository: phoenix Updated Branches: refs/heads/master ed7d0e978 - 67c4c4597 PHOENIX-900 Partial results for mutations Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/67c4c459 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/67c4c459 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/67c4c459 Branch: refs/heads/master Commit: 67c4c4597c9154f19f977e0747a5258daa766486 Parents: ed7d0e9 Author: Eli Levine elilev...@apache.org Authored: Tue Apr 21 17:58:43 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Tue Apr 21 17:58:43 2015 -0700 -- .../apache/phoenix/execute/PartialCommitIT.java | 302 +++ .../apache/phoenix/compile/DeleteCompiler.java | 13 +- .../apache/phoenix/compile/UpsertCompiler.java | 13 +- .../apache/phoenix/execute/CommitException.java | 35 ++- .../apache/phoenix/execute/MutationState.java | 158 ++ .../apache/phoenix/jdbc/PhoenixConnection.java | 33 +- .../phoenix/jdbc/PhoenixPreparedStatement.java | 7 +- .../apache/phoenix/jdbc/PhoenixStatement.java | 3 + .../phoenix/execute/MutationStateTest.java | 64 .../java/org/apache/phoenix/query/BaseTest.java | 2 +- 10 files changed, 542 insertions(+), 88 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/67c4c459/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java new file mode 100644 index 000..550d7de --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java @@ -0,0 +1,302 @@ +/* + * Copyright 2014 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.execute; + +import static com.google.common.collect.Lists.newArrayList; +import static com.google.common.collect.Sets.newHashSet; +import static java.util.Collections.singletonList; +import static org.apache.phoenix.query.BaseTest.initAndRegisterDriver; +import static org.apache.phoenix.query.BaseTest.setUpConfigForMiniCluster; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL_TERMINATOR; +import static org.apache.phoenix.util.PhoenixRuntime.PHOENIX_TEST_DRIVER_URL_PARAM; +import static org.apache.phoenix.util.TestUtil.LOCALHOST; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.sql.Connection; +import java.sql.Driver; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.HBaseIOException; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.client.Durability; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.coprocessor.ObserverContext; +import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; +import org.apache.hadoop.hbase.coprocessor.RegionObserver; +import org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver; +import org.apache.hadoop.hbase.regionserver.wal.WALEdit; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; +import org.apache.phoenix.hbase.index.Indexer; +import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; +import org.apache.phoenix.jdbc.PhoenixConnection; +import org.apache.phoenix.query.QueryServices; +import org.apache.phoenix.schema.TableRef; +import org.apache.phoenix.util.PhoenixRuntime; +import
phoenix git commit: PHOENIX-900 Partial results for mutations
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 9b7fefe28 - 97f28b1cc PHOENIX-900 Partial results for mutations Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/97f28b1c Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/97f28b1c Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/97f28b1c Branch: refs/heads/4.x-HBase-0.98 Commit: 97f28b1cc3cffc24f9064874ffe19df5564962cf Parents: 9b7fefe Author: Eli Levine elilev...@apache.org Authored: Tue Apr 21 17:49:30 2015 -0700 Committer: Eli Levine elilev...@apache.org Committed: Tue Apr 21 17:49:30 2015 -0700 -- .../apache/phoenix/execute/PartialCommitIT.java | 302 +++ .../apache/phoenix/compile/DeleteCompiler.java | 13 +- .../apache/phoenix/compile/UpsertCompiler.java | 13 +- .../apache/phoenix/execute/CommitException.java | 35 ++- .../apache/phoenix/execute/MutationState.java | 158 ++ .../apache/phoenix/jdbc/PhoenixConnection.java | 33 +- .../phoenix/jdbc/PhoenixPreparedStatement.java | 7 +- .../apache/phoenix/jdbc/PhoenixStatement.java | 3 + .../phoenix/execute/MutationStateTest.java | 64 .../java/org/apache/phoenix/query/BaseTest.java | 2 +- 10 files changed, 542 insertions(+), 88 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/97f28b1c/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java new file mode 100644 index 000..550d7de --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java @@ -0,0 +1,302 @@ +/* + * Copyright 2014 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.execute; + +import static com.google.common.collect.Lists.newArrayList; +import static com.google.common.collect.Sets.newHashSet; +import static java.util.Collections.singletonList; +import static org.apache.phoenix.query.BaseTest.initAndRegisterDriver; +import static org.apache.phoenix.query.BaseTest.setUpConfigForMiniCluster; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL_TERMINATOR; +import static org.apache.phoenix.util.PhoenixRuntime.PHOENIX_TEST_DRIVER_URL_PARAM; +import static org.apache.phoenix.util.TestUtil.LOCALHOST; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.sql.Connection; +import java.sql.Driver; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.HBaseIOException; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.client.Durability; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.coprocessor.ObserverContext; +import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; +import org.apache.hadoop.hbase.coprocessor.RegionObserver; +import org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver; +import org.apache.hadoop.hbase.regionserver.wal.WALEdit; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; +import org.apache.phoenix.hbase.index.Indexer; +import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; +import org.apache.phoenix.jdbc.PhoenixConnection; +import org.apache.phoenix.query.QueryServices; +import org.apache.phoenix.schema.TableRef; +import
phoenix git commit: Revert Surface partial saves in CommitExcepiton (PHOENIX-900) from https://github.com/apache/phoenix/pull/37
Repository: phoenix Updated Branches: refs/heads/4.0 43d58a7bd - c668ce12c Revert Surface partial saves in CommitExcepiton (PHOENIX-900) from https://github.com/apache/phoenix/pull/37; This reverts commit 43d58a7bd98238ab4d45efd56b99c3b3a35e3550. Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/c668ce12 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/c668ce12 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/c668ce12 Branch: refs/heads/4.0 Commit: c668ce12c908b28254c4aeb6577bf1f51b0e5fe5 Parents: 43d58a7 Author: Eli Levine elilev...@apache.org Authored: Fri Feb 27 11:16:57 2015 -0800 Committer: Eli Levine elilev...@apache.org Committed: Fri Feb 27 11:16:57 2015 -0800 -- .../apache/phoenix/execute/PartialCommitIT.java | 302 --- .../apache/phoenix/compile/DeleteCompiler.java | 13 +- .../apache/phoenix/compile/UpsertCompiler.java | 13 +- .../apache/phoenix/execute/CommitException.java | 35 +-- .../apache/phoenix/execute/MutationState.java | 156 -- .../apache/phoenix/jdbc/PhoenixConnection.java | 37 +-- .../phoenix/jdbc/PhoenixPreparedStatement.java | 7 +- .../apache/phoenix/jdbc/PhoenixStatement.java | 3 - .../phoenix/execute/MutationStateTest.java | 64 .../java/org/apache/phoenix/query/BaseTest.java | 2 +- 10 files changed, 89 insertions(+), 543 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/c668ce12/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java deleted file mode 100644 index 550d7de..000 --- a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright 2014 The Apache Software Foundation - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * License); you maynot use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicablelaw or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.phoenix.execute; - -import static com.google.common.collect.Lists.newArrayList; -import static com.google.common.collect.Sets.newHashSet; -import static java.util.Collections.singletonList; -import static org.apache.phoenix.query.BaseTest.initAndRegisterDriver; -import static org.apache.phoenix.query.BaseTest.setUpConfigForMiniCluster; -import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL; -import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR; -import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL_TERMINATOR; -import static org.apache.phoenix.util.PhoenixRuntime.PHOENIX_TEST_DRIVER_URL_PARAM; -import static org.apache.phoenix.util.TestUtil.LOCALHOST; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.sql.Connection; -import java.sql.Driver; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.DoNotRetryIOException; -import org.apache.hadoop.hbase.HBaseIOException; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.client.Durability; -import org.apache.hadoop.hbase.client.Put; -import org.apache.hadoop.hbase.coprocessor.ObserverContext; -import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; -import org.apache.hadoop.hbase.coprocessor.RegionObserver; -import org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver; -import org.apache.hadoop.hbase.regionserver.wal.WALEdit; -import org.apache.hadoop.hbase.util.Bytes; -import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; -import org.apache.phoenix.hbase.index.Indexer; -import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; -import org.apache.phoenix.jdbc.PhoenixConnection; -import
phoenix git commit: Surface partial saves in CommitExcepiton (PHOENIX-900) from https://github.com/apache/phoenix/pull/37
Repository: phoenix Updated Branches: refs/heads/4.0 b9d1722c6 - 43d58a7bd Surface partial saves in CommitExcepiton (PHOENIX-900) from https://github.com/apache/phoenix/pull/37 Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/43d58a7b Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/43d58a7b Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/43d58a7b Branch: refs/heads/4.0 Commit: 43d58a7bd98238ab4d45efd56b99c3b3a35e3550 Parents: b9d1722 Author: Eli Levine elilev...@apache.org Authored: Thu Feb 26 21:04:25 2015 -0800 Committer: Eli Levine elilev...@apache.org Committed: Thu Feb 26 21:04:25 2015 -0800 -- .../apache/phoenix/execute/PartialCommitIT.java | 302 +++ .../apache/phoenix/compile/DeleteCompiler.java | 13 +- .../apache/phoenix/compile/UpsertCompiler.java | 13 +- .../apache/phoenix/execute/CommitException.java | 35 ++- .../apache/phoenix/execute/MutationState.java | 156 ++ .../apache/phoenix/jdbc/PhoenixConnection.java | 37 ++- .../phoenix/jdbc/PhoenixPreparedStatement.java | 7 +- .../apache/phoenix/jdbc/PhoenixStatement.java | 3 + .../phoenix/execute/MutationStateTest.java | 64 .../java/org/apache/phoenix/query/BaseTest.java | 2 +- 10 files changed, 543 insertions(+), 89 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/43d58a7b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java new file mode 100644 index 000..550d7de --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java @@ -0,0 +1,302 @@ +/* + * Copyright 2014 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.execute; + +import static com.google.common.collect.Lists.newArrayList; +import static com.google.common.collect.Sets.newHashSet; +import static java.util.Collections.singletonList; +import static org.apache.phoenix.query.BaseTest.initAndRegisterDriver; +import static org.apache.phoenix.query.BaseTest.setUpConfigForMiniCluster; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL_TERMINATOR; +import static org.apache.phoenix.util.PhoenixRuntime.PHOENIX_TEST_DRIVER_URL_PARAM; +import static org.apache.phoenix.util.TestUtil.LOCALHOST; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.sql.Connection; +import java.sql.Driver; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.HBaseIOException; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.client.Durability; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.coprocessor.ObserverContext; +import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; +import org.apache.hadoop.hbase.coprocessor.RegionObserver; +import org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver; +import org.apache.hadoop.hbase.regionserver.wal.WALEdit; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; +import org.apache.phoenix.hbase.index.Indexer; +import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; +import org.apache.phoenix.jdbc.PhoenixConnection; +import org.apache.phoenix.query.QueryServices; +import org.apache.phoenix.schema.TableRef;
phoenix git commit: Surface partial saves in CommitExcepiton (PHOENIX-900) from https://github.com/apache/phoenix/pull/37
Repository: phoenix Updated Branches: refs/heads/master dab9d51bf - fa58c7821 Surface partial saves in CommitExcepiton (PHOENIX-900) from https://github.com/apache/phoenix/pull/37 Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/fa58c782 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/fa58c782 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/fa58c782 Branch: refs/heads/master Commit: fa58c7821a2e8fce30a8c0ff6e42aa00134dbce0 Parents: dab9d51 Author: Eli Levine elilev...@apache.org Authored: Thu Feb 26 20:50:02 2015 -0800 Committer: Eli Levine elilev...@apache.org Committed: Thu Feb 26 20:50:02 2015 -0800 -- .../apache/phoenix/execute/PartialCommitIT.java | 302 +++ .../apache/phoenix/compile/DeleteCompiler.java | 13 +- .../apache/phoenix/compile/UpsertCompiler.java | 13 +- .../apache/phoenix/execute/CommitException.java | 35 ++- .../apache/phoenix/execute/MutationState.java | 156 ++ .../apache/phoenix/jdbc/PhoenixConnection.java | 37 ++- .../phoenix/jdbc/PhoenixPreparedStatement.java | 7 +- .../apache/phoenix/jdbc/PhoenixStatement.java | 3 + .../phoenix/execute/MutationStateTest.java | 64 .../java/org/apache/phoenix/query/BaseTest.java | 2 +- 10 files changed, 543 insertions(+), 89 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/fa58c782/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java new file mode 100644 index 000..550d7de --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java @@ -0,0 +1,302 @@ +/* + * Copyright 2014 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you maynot use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicablelaw or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.execute; + +import static com.google.common.collect.Lists.newArrayList; +import static com.google.common.collect.Sets.newHashSet; +import static java.util.Collections.singletonList; +import static org.apache.phoenix.query.BaseTest.initAndRegisterDriver; +import static org.apache.phoenix.query.BaseTest.setUpConfigForMiniCluster; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR; +import static org.apache.phoenix.util.PhoenixRuntime.JDBC_PROTOCOL_TERMINATOR; +import static org.apache.phoenix.util.PhoenixRuntime.PHOENIX_TEST_DRIVER_URL_PARAM; +import static org.apache.phoenix.util.TestUtil.LOCALHOST; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.sql.Connection; +import java.sql.Driver; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.HBaseIOException; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.client.Durability; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.coprocessor.ObserverContext; +import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; +import org.apache.hadoop.hbase.coprocessor.RegionObserver; +import org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver; +import org.apache.hadoop.hbase.regionserver.wal.WALEdit; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; +import org.apache.phoenix.hbase.index.Indexer; +import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; +import org.apache.phoenix.jdbc.PhoenixConnection; +import org.apache.phoenix.query.QueryServices; +import
svn commit: r1635824 - in /phoenix/site: publish/team.html source/src/site/markdown/team.md
Author: elilevine Date: Fri Oct 31 17:44:27 2014 New Revision: 1635824 URL: http://svn.apache.org/r1635824 Log: Fixed my email address on team.html Modified: phoenix/site/publish/team.html phoenix/site/source/src/site/markdown/team.md Modified: phoenix/site/publish/team.html URL: http://svn.apache.org/viewvc/phoenix/site/publish/team.html?rev=1635824r1=1635823r2=1635824view=diff == --- phoenix/site/publish/team.html (original) +++ phoenix/site/publish/team.html Fri Oct 31 17:44:27 2014 @@ -1,7 +1,7 @@ !DOCTYPE html !-- - Generated by Apache Maven Doxia at 2014-10-30 + Generated by Apache Maven Doxia at 2014-10-31 Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin) -- html xml:lang=en lang=en @@ -189,7 +189,7 @@ tr class=b tdEli Levine /td tdSalesforce /td - tda class=externalLink href=mailto:elev...@apache.org;elev...@apache.org/a /td + tda class=externalLink href=mailto:elilev...@apache.org;elilev...@apache.org/a /td tdPMC/td /tr tr class=a Modified: phoenix/site/source/src/site/markdown/team.md URL: http://svn.apache.org/viewvc/phoenix/site/source/src/site/markdown/team.md?rev=1635824r1=1635823r2=1635824view=diff == --- phoenix/site/source/src/site/markdown/team.md (original) +++ phoenix/site/source/src/site/markdown/team.md Fri Oct 31 17:44:27 2014 @@ -15,7 +15,7 @@ Steven Noels | NG Data | stevenn@apache. Michael Stack | Cloudera | st...@apache.org | PMC James Taylor | Salesforce | jamestay...@apache.org | PMC Jesse Yates | Salesforce | jya...@apache.org | PMC -Eli Levine | Salesforce | elev...@apache.org | PMC +Eli Levine | Salesforce | elilev...@apache.org | PMC Simon Toens | Salesforce | sto...@apache.org | PMC Mujtaba Chohan | Salesforce | mujt...@apache.org | PMC Maryann Xue | Intel | maryann...@apache.org | PMC
git commit: Added custom annotations to logs in query-related functionality in client- and server-side code for PHOENIX-1198
Repository: phoenix Updated Branches: refs/heads/master 6b0461002 - 3acedb726 Added custom annotations to logs in query-related functionality in client- and server-side code for PHOENIX-1198 Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/3acedb72 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3acedb72 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3acedb72 Branch: refs/heads/master Commit: 3acedb7262dbf5241e443a2769565e6750b4ac14 Parents: 6b04610 Author: Eli Levine elilev...@apache.org Authored: Fri Sep 26 10:47:33 2014 -0700 Committer: Eli Levine elilev...@apache.org Committed: Fri Sep 26 10:47:33 2014 -0700 -- .../apache/phoenix/cache/ServerCacheClient.java | 18 +++-- .../apache/phoenix/compile/FromCompiler.java| 3 +- .../coprocessor/BaseScannerRegionObserver.java | 5 +++ .../GroupedAggregateRegionObserver.java | 39 +++- .../UngroupedAggregateRegionObserver.java | 7 ++-- .../apache/phoenix/execute/BaseQueryPlan.java | 15 .../apache/phoenix/execute/HashJoinPlan.java| 5 +-- .../apache/phoenix/execute/MutationState.java | 12 +++--- .../phoenix/iterate/ChunkedResultIterator.java | 14 +-- .../phoenix/iterate/ConcatResultIterator.java | 5 +++ .../DefaultParallelIteratorRegionSplitter.java | 3 +- .../DistinctAggregatingResultIterator.java | 7 .../FilterAggregatingResultIterator.java| 6 +++ .../phoenix/iterate/FilterResultIterator.java | 6 +++ .../GroupedAggregatingResultIterator.java | 7 .../phoenix/iterate/LimitingResultIterator.java | 5 +++ .../iterate/MergeSortRowKeyResultIterator.java | 6 +++ .../iterate/MergeSortTopNResultIterator.java| 7 .../phoenix/iterate/OrderedResultIterator.java | 10 + .../phoenix/iterate/ParallelIterators.java | 8 +++- .../iterate/RegionScannerResultIterator.java| 5 +++ .../phoenix/iterate/ScanningResultIterator.java | 5 +++ .../phoenix/iterate/SequenceResultIterator.java | 6 +++ .../phoenix/iterate/TableResultIterator.java| 6 +++ .../UngroupedAggregatingResultIterator.java | 6 +++ .../query/ConnectionQueryServicesImpl.java | 1 - .../apache/phoenix/schema/MetaDataClient.java | 7 ++-- .../org/apache/phoenix/trace/TraceReader.java | 2 +- .../apache/phoenix/trace/TracingIterator.java | 5 +++ .../java/org/apache/phoenix/util/LogUtil.java | 27 -- .../java/org/apache/phoenix/util/ScanUtil.java | 10 + .../org/apache/phoenix/util/LogUtilTest.java| 27 +++--- 32 files changed, 231 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/3acedb72/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java index 1301fb7..fa19881 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java @@ -167,7 +167,7 @@ public class ServerCacheClient { if ( ! servers.contains(entry) keyRanges.intersect(entry.getRegionInfo().getStartKey(), entry.getRegionInfo().getEndKey())) { // Call RPC once per server servers.add(entry); -if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations(Adding cache entry to be sent for + entry, connection.getCustomTracingAnnotations()));} +if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations(Adding cache entry to be sent for + entry, connection));} final byte[] key = entry.getRegionInfo().getStartKey(); final HTableInterface htable = services.getTable(cacheUsingTableRef.getTable().getPhysicalName().getBytes()); closeables.add(htable); @@ -220,7 +220,7 @@ public class ServerCacheClient { } })); } else { -if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations(NOT adding cache entry to be sent for + entry + since one already exists for that entry, connection.getCustomTracingAnnotations()));} +if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations(NOT adding cache entry to be sent for + entry + since one already exists for that entry, connection));} } } @@ -259,7 +259,7 @@ public class ServerCacheClient { } } } -if (LOG.isDebugEnabled())
git commit: Added custom annotations to logs in query-related functionality in client- and server-side code for PHOENIX-1198
Repository: phoenix Updated Branches: refs/heads/4.0 4070492a9 - 4edfed646 Added custom annotations to logs in query-related functionality in client- and server-side code for PHOENIX-1198 Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/4edfed64 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/4edfed64 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/4edfed64 Branch: refs/heads/4.0 Commit: 4edfed646f98e4065746020a5cfb3c354fc5bc45 Parents: 4070492 Author: Eli Levine elilev...@apache.org Authored: Fri Sep 26 10:48:47 2014 -0700 Committer: Eli Levine elilev...@apache.org Committed: Fri Sep 26 10:48:47 2014 -0700 -- .../apache/phoenix/cache/ServerCacheClient.java | 18 +++-- .../apache/phoenix/compile/FromCompiler.java| 3 +- .../coprocessor/BaseScannerRegionObserver.java | 5 +++ .../GroupedAggregateRegionObserver.java | 39 +++- .../UngroupedAggregateRegionObserver.java | 7 ++-- .../apache/phoenix/execute/BaseQueryPlan.java | 15 .../apache/phoenix/execute/HashJoinPlan.java| 5 +-- .../apache/phoenix/execute/MutationState.java | 12 +++--- .../phoenix/iterate/ChunkedResultIterator.java | 14 +-- .../phoenix/iterate/ConcatResultIterator.java | 5 +++ .../DefaultParallelIteratorRegionSplitter.java | 3 +- .../DistinctAggregatingResultIterator.java | 7 .../FilterAggregatingResultIterator.java| 6 +++ .../phoenix/iterate/FilterResultIterator.java | 6 +++ .../GroupedAggregatingResultIterator.java | 7 .../phoenix/iterate/LimitingResultIterator.java | 5 +++ .../iterate/MergeSortRowKeyResultIterator.java | 6 +++ .../iterate/MergeSortTopNResultIterator.java| 7 .../phoenix/iterate/OrderedResultIterator.java | 10 + .../phoenix/iterate/ParallelIterators.java | 8 +++- .../iterate/RegionScannerResultIterator.java| 5 +++ .../phoenix/iterate/ScanningResultIterator.java | 5 +++ .../phoenix/iterate/SequenceResultIterator.java | 6 +++ .../phoenix/iterate/TableResultIterator.java| 6 +++ .../UngroupedAggregatingResultIterator.java | 6 +++ .../query/ConnectionQueryServicesImpl.java | 1 - .../apache/phoenix/schema/MetaDataClient.java | 7 ++-- .../org/apache/phoenix/trace/TraceReader.java | 2 +- .../apache/phoenix/trace/TracingIterator.java | 5 +++ .../java/org/apache/phoenix/util/LogUtil.java | 27 -- .../java/org/apache/phoenix/util/ScanUtil.java | 10 + .../org/apache/phoenix/util/LogUtilTest.java| 27 +++--- 32 files changed, 231 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/4edfed64/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java index 1301fb7..fa19881 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java @@ -167,7 +167,7 @@ public class ServerCacheClient { if ( ! servers.contains(entry) keyRanges.intersect(entry.getRegionInfo().getStartKey(), entry.getRegionInfo().getEndKey())) { // Call RPC once per server servers.add(entry); -if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations(Adding cache entry to be sent for + entry, connection.getCustomTracingAnnotations()));} +if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations(Adding cache entry to be sent for + entry, connection));} final byte[] key = entry.getRegionInfo().getStartKey(); final HTableInterface htable = services.getTable(cacheUsingTableRef.getTable().getPhysicalName().getBytes()); closeables.add(htable); @@ -220,7 +220,7 @@ public class ServerCacheClient { } })); } else { -if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations(NOT adding cache entry to be sent for + entry + since one already exists for that entry, connection.getCustomTracingAnnotations()));} +if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations(NOT adding cache entry to be sent for + entry + since one already exists for that entry, connection));} } } @@ -259,7 +259,7 @@ public class ServerCacheClient { } } } -if (LOG.isDebugEnabled())
git commit: Custom tracing annotations PHOENIX-1196
Repository: phoenix Updated Branches: refs/heads/4.0 c84b5f925 - e5a576751 Custom tracing annotations PHOENIX-1196 Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/e5a57675 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/e5a57675 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/e5a57675 Branch: refs/heads/4.0 Commit: e5a576751442f77725eeb30d69d4e0ec30fc0816 Parents: c84b5f9 Author: Eli Levine elilev...@apache.org Authored: Thu Sep 18 20:31:19 2014 -0700 Committer: Eli Levine elilev...@apache.org Committed: Fri Sep 19 10:05:10 2014 -0700 -- .../apache/phoenix/trace/BaseTracingTestIT.java | 16 - .../phoenix/trace/PhoenixTracingEndToEndIT.java | 61 .../apache/phoenix/jdbc/PhoenixConnection.java | 22 +++ .../org/apache/phoenix/trace/util/Tracing.java | 21 +++ .../java/org/apache/phoenix/util/JDBCUtil.java | 45 ++- .../org/apache/phoenix/util/PhoenixRuntime.java | 7 +++ .../org/apache/phoenix/util/JDBCUtilTest.java | 59 +++ 7 files changed, 228 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/e5a57675/phoenix-core/src/it/java/org/apache/phoenix/trace/BaseTracingTestIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/trace/BaseTracingTestIT.java b/phoenix-core/src/it/java/org/apache/phoenix/trace/BaseTracingTestIT.java index 1f4990b..92b2250 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/trace/BaseTracingTestIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/trace/BaseTracingTestIT.java @@ -17,11 +17,14 @@ */ package org.apache.phoenix.trace; +import static org.apache.phoenix.util.PhoenixRuntime.ANNOTATION_ATTRIB_PREFIX; import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; +import java.util.Collections; +import java.util.Map; import java.util.Properties; import org.apache.commons.logging.Log; @@ -36,6 +39,7 @@ import org.apache.phoenix.query.QueryServicesOptions; import org.apache.phoenix.schema.TableNotFoundException; import org.apache.phoenix.trace.util.Tracing; import org.apache.phoenix.trace.util.Tracing.Frequency; +import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.PropertiesUtil; import org.junit.Before; @@ -86,9 +90,19 @@ public class BaseTracingTestIT extends BaseHBaseManagedTimeIT { conn.setAutoCommit(false); return conn; } + +public static Connection getTracingConnection() throws Exception { + return getTracingConnection(Collections.String, StringemptyMap(), null); +} -public static Connection getTracingConnection() throws Exception { +public static Connection getTracingConnection(MapString, String customAnnotations, String tenantId) throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); +for (Map.EntryString, String annot : customAnnotations.entrySet()) { + props.put(ANNOTATION_ATTRIB_PREFIX + annot.getKey(), annot.getValue()); +} +if (tenantId != null) { + props.put(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); +} return getConnectionWithTracingFrequency(props, Tracing.Frequency.ALWAYS); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/e5a57675/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java b/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java index 6742f9e..0fc80ed 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java @@ -17,6 +17,7 @@ */ package org.apache.phoenix.trace; +import static org.apache.phoenix.util.PhoenixRuntime.TENANT_ID_ATTRIB; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -49,6 +50,8 @@ import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import com.google.common.collect.ImmutableMap; + /** * Test that the logging sink stores the expected metrics/stats */ @@ -353,7 +356,65 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT { }); assertTrue(Didn't find the parallel scanner in the tracing, found); } + +@Test +public void testCustomAnnotationTracing() throws Exception { + final String customAnnotationKey =
svn commit: r1626299 - in /phoenix/site: publish/tracing.html source/src/site/markdown/tracing.md
Author: elilevine Date: Fri Sep 19 19:12:58 2014 New Revision: 1626299 URL: http://svn.apache.org/r1626299 Log: Add info on custom annotations to tracing.html Modified: phoenix/site/publish/tracing.html phoenix/site/source/src/site/markdown/tracing.md Modified: phoenix/site/publish/tracing.html URL: http://svn.apache.org/viewvc/phoenix/site/publish/tracing.html?rev=1626299r1=1626298r2=1626299view=diff == --- phoenix/site/publish/tracing.html (original) +++ phoenix/site/publish/tracing.html Fri Sep 19 19:12:58 2014 @@ -1,7 +1,7 @@ !DOCTYPE html !-- - Generated by Apache Maven Doxia at 2014-09-04 + Generated by Apache Maven Doxia at 2014-09-19 Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin) -- html xml:lang=en lang=en @@ -269,6 +269,7 @@ Connection conn = DriverManager.getConne /div pwhere columns is either ttannotations.aX/tt or tttags.tX/tt where ttX/tt is the index of the dynamic column to lookup./p pFor more usage, look at our generic a class=externalLink href=https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/trace/TraceReader.java;TraceReader/a which can programatically read a number of traces from the tracing results table./p + pCustom annotations can also be passed into Phoenix to be added to traces. Phoenix looks for connection properties whose names start with ttphoenix.annotation./tt and adds these as annotations to client-side traces. e.g. A connection property ttphoenix.annotation.myannotation=abc/tt will result in annotations with key ttmyannotation/tt and value ttabc/tt to be added to traces. Use this feature to link traces to other request identifiers in your system, such as user or session ids./p /div /div /div Modified: phoenix/site/source/src/site/markdown/tracing.md URL: http://svn.apache.org/viewvc/phoenix/site/source/src/site/markdown/tracing.md?rev=1626299r1=1626298r2=1626299view=diff == --- phoenix/site/source/src/site/markdown/tracing.md (original) +++ phoenix/site/source/src/site/markdown/tracing.md Fri Sep 19 19:12:58 2014 @@ -154,3 +154,5 @@ SELECT columns where columns is either codeannotations.aX/code or codetags.tX/code where codeX/code is the index of the dynamic column to lookup. For more usage, look at our generic [TraceReader](https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/trace/TraceReader.java) which can programatically read a number of traces from the tracing results table. + +Custom annotations can also be passed into Phoenix to be added to traces. Phoenix looks for connection properties whose names start with `phoenix.annotation.` and adds these as annotations to client-side traces. e.g. A connection property `phoenix.annotation.myannotation=abc` will result in annotations with key `myannotation` and value `abc` to be added to traces. Use this feature to link traces to other request identifiers in your system, such as user or session ids.
git commit: First pass at PHOENIX-1198: added custom annotations to client-side log lines that are within the scope of a user operation
Repository: phoenix Updated Branches: refs/heads/master bca79af4a - 1f54dfe76 First pass at PHOENIX-1198: added custom annotations to client-side log lines that are within the scope of a user operation Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/1f54dfe7 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/1f54dfe7 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/1f54dfe7 Branch: refs/heads/master Commit: 1f54dfe7691e73f21bea2a67a1fb42edac706641 Parents: bca79af Author: Eli Levine elilev...@apache.org Authored: Fri Sep 19 16:13:05 2014 -0700 Committer: Eli Levine elilev...@apache.org Committed: Fri Sep 19 16:13:05 2014 -0700 -- .../phoenix/trace/PhoenixTracingEndToEndIT.java | 2 +- .../apache/phoenix/cache/ServerCacheClient.java | 23 +++--- .../apache/phoenix/execute/HashJoinPlan.java| 16 +-- .../org/apache/phoenix/query/QueryServices.java | 1 + .../org/apache/phoenix/trace/TraceReader.java | 24 --- .../org/apache/phoenix/trace/util/Tracing.java | 3 +- .../java/org/apache/phoenix/util/LogUtil.java | 34 +++ .../org/apache/phoenix/util/LogUtilTest.java| 45 .../org/apache/phoenix/trace/TracingCompat.java | 2 +- 9 files changed, 131 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/1f54dfe7/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java b/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java index 0fc80ed..87d80da 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java @@ -467,4 +467,4 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT { } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/phoenix/blob/1f54dfe7/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java index f4be508..1301fb7 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java @@ -17,6 +17,9 @@ */ package org.apache.phoenix.cache; +import static java.util.Collections.emptyMap; +import static org.apache.phoenix.util.LogUtil.addCustomAnnotations; + import java.io.Closeable; import java.io.IOException; import java.sql.SQLException; @@ -164,7 +167,7 @@ public class ServerCacheClient { if ( ! servers.contains(entry) keyRanges.intersect(entry.getRegionInfo().getStartKey(), entry.getRegionInfo().getEndKey())) { // Call RPC once per server servers.add(entry); -if (LOG.isDebugEnabled()) {LOG.debug(Adding cache entry to be sent for + entry);} +if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations(Adding cache entry to be sent for + entry, connection.getCustomTracingAnnotations()));} final byte[] key = entry.getRegionInfo().getStartKey(); final HTableInterface htable = services.getTable(cacheUsingTableRef.getTable().getPhysicalName().getBytes()); closeables.add(htable); @@ -217,7 +220,7 @@ public class ServerCacheClient { } })); } else { -if (LOG.isDebugEnabled()) {LOG.debug(NOT adding cache entry to be sent for + entry + since one already exists for that entry);} +if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations(NOT adding cache entry to be sent for + entry + since one already exists for that entry, connection.getCustomTracingAnnotations()));} } } @@ -256,7 +259,7 @@ public class ServerCacheClient { } } } -if (LOG.isDebugEnabled()) {LOG.debug(Cache + cacheId + successfully added to servers.);} +if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations(Cache + cacheId + successfully added to servers., connection.getCustomTracingAnnotations()));} return hashCacheSpec; } @@ -282,7 +285,7 @@ public class ServerCacheClient { * this, we iterate through the current metadata boundaries and remove the cache
svn commit: r1620952 - in /phoenix/site: publish/multi-tenancy.html source/src/site/markdown/multi-tenancy.md
Author: elilevine Date: Wed Aug 27 18:26:23 2014 New Revision: 1620952 URL: http://svn.apache.org/r1620952 Log: Update multi-tenancy docs for PHOENIX-1204 Modified: phoenix/site/publish/multi-tenancy.html phoenix/site/source/src/site/markdown/multi-tenancy.md Modified: phoenix/site/publish/multi-tenancy.html URL: http://svn.apache.org/viewvc/phoenix/site/publish/multi-tenancy.html?rev=1620952r1=1620951r2=1620952view=diff == --- phoenix/site/publish/multi-tenancy.html (original) +++ phoenix/site/publish/multi-tenancy.html Wed Aug 27 18:26:23 2014 @@ -1,7 +1,7 @@ !DOCTYPE html !-- - Generated by Apache Maven Doxia at 2014-08-18 + Generated by Apache Maven Doxia at 2014-08-26 Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin) -- html xml:lang=en lang=en @@ -124,30 +124,34 @@ div class=page-header h1Multi tenancy/h1 /div -pSupport for multi-tenancy is built on top of the concepts of a a href=views.htmlVIEW/a in Phoenix. Users create a logical tenant-specific table as a VIEW and query and update it just like with regular Phoenix tables. Data in these tenant-specific tables resides in a shared, regular Phoenix table (and thus in a shared HBase table) that is declared at table creation time to support multi-tenancy. All tenant-specific Phoenix tables whose data resides in the same physical HBase table have the same primary key structure but each tenantâs table can contain any number of non-PK columns unique to it. The main advantages afforded by this feature are:/p -ol style=list-style-type: decimal - liIt implements physical tenant data isolation, including automatically constraining tenants to only work with data that âbelongsâ to the each tenant./li - liIt prevents a proliferation of HBase tables, minimizing operational complexity./li -/ol div class=section div class=section + h3 id=HighlightsHighlights/h3 + ul + liMulti-tenancy in Phoenix works via a combination of multi-tenant tables and tenant-specific connections (detailed below)./li + liTenants open tenant-specific connections to Phoenix. These connections can only access data that belongs to the tenant./li + liTenants only see their own data in multi-tenant tables and can see all data in regular tables./li + liIn order to add their own columns, tenants create tanant-specific views on top of multi-tenant tables and add their own columns to the views./li + /ul + /div + div class=section h3 id=Multi-tenant_tablesMulti-tenant tables/h3 - pThe first primary key column of the physical multi-tenant table must be used to identify the tenant. For example:/p + pMulti-tenant tables in Phoenix are regular tables that are declared using the MULTI_TENANT=true DDL property. They work in conjuntion with tenant-specific connections (detailed below) to ensure that tenats only see their data in such tables. The first primary key column of multi-tenant tables identifies the tenant. For example:/p div class=source preCREATE TABLE base.event (tenant_id VARCHAR, event_type CHAR(1), created_date DATE, event_id BIGINT) MULTI_TENANT=true; /pre /div - pIn this case, the tenant_id column identifies the tenant and the table is declared to be multi-tenant. The column that identifies the tenant may be given any name, but must of type VARCHAR or CHAR./p + pThe column that identifies the tenant may be given any name, but must of type VARCHAR or CHAR. Regular Phoenix connections work with such tables with no constraints, including working with data across tenant boundaries./p /div div class=section - h3 id=Tenant-specific_TablesTenant-specific Tables/h3 - pTenants are identified by the presence or absence of a TenantId property at JDBC connection-time. A connection with a non-null TenantId is considered a tenant-specific connection. A connection with an unspecified or null TenantId is a regular connection. A tenant specific connection may only query:/p + h3 id=Tenant-specific_ConnectionsTenant-specific Connections/h3 + pTenants are identified by the presence or absence of the TenantId property at JDBC connection-time. A connection with a non-null TenantId is considered a tenant-specific connection. A connection with an unspecified or null TenantId is a regular connection. A tenant-specific connection may only query:/p ul - libtheir own schema/b, which is to say it only sees tenant-specific views that were created by that tenant./li - libnon multi-tenant global tables/b, that is tables created with a regular connection without the MULTI_TENANT=TRUE declaration./li + liball data in non-multi-tenant (global) tables/b, that is tables created with a regular connection without the MULTI_TENANT=true declaration./li + libtheir own data in multi-tenant tables/b./li + libtheir own schema/b, which is to say it only sees tenant