You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2018/02/15 19:58:32 UTC

phoenix git commit: PHOENIX-2566 Support NOT NULL constraint for any column for immutable table (addendum 4)

Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 8b1197053 -> 5e56ab47f


PHOENIX-2566 Support NOT NULL constraint for any column for immutable table (addendum 4)


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 5e56ab47f26a45a1bb46b581a8b45a30b6e58b5e
Parents: 8b11970
Author: James Taylor <jt...@salesforce.com>
Authored: Thu Feb 15 11:58:19 2018 -0800
Committer: James Taylor <jt...@salesforce.com>
Committed: Thu Feb 15 11:58:19 2018 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/schema/MetaDataClient.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5e56ab47/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
index 6fa0141..b3d455e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
@@ -3238,6 +3238,7 @@ public class MetaDataClient {
                         changingPhoenixTableProperty = true;
                     }
                 }
+                boolean willBeImmutableRows = Boolean.TRUE.equals(isImmutableRows) || (isImmutableRows == null && table.isImmutableRows());
                 Boolean multiTenant = null;
                 if (multiTenantProp != null) {
                     if (multiTenantProp.booleanValue() != table.isMultiTenant()) {
@@ -3350,7 +3351,7 @@ public class MetaDataClient {
                                     throw new SQLExceptionInfo.Builder(SQLExceptionCode.NOT_NULLABLE_COLUMN_IN_ROW_KEY)
                                     .setColumnName(colDef.getColumnDefName().getColumnName()).build().buildException();
                                 // changing to immutable or already immutable
-                                } else if (Boolean.TRUE.equals(isImmutableRows) || (isImmutableRows == null && table.isImmutableRows())) {
+                                } else if (!willBeImmutableRows) {
                                     throw new SQLExceptionInfo.Builder(SQLExceptionCode.KEY_VALUE_NOT_NULL)
                                     .setColumnName(colDef.getColumnDefName().getColumnName()).build().buildException();
                                 }
@@ -3395,7 +3396,7 @@ public class MetaDataClient {
                                 .setSchemaName(schemaName)
                                 .setTableName(tableName).build().buildException();
                             }
-                            PColumn column = newColumn(position++, colDef, PrimaryKeyConstraint.EMPTY, table.getDefaultFamilyName() == null ? null : table.getDefaultFamilyName().getString(), true, columnQualifierBytes, isImmutableRows);
+                            PColumn column = newColumn(position++, colDef, PrimaryKeyConstraint.EMPTY, table.getDefaultFamilyName() == null ? null : table.getDefaultFamilyName().getString(), true, columnQualifierBytes, willBeImmutableRows);
                             columns.add(column);
                             String pkName = null;
                             Short keySeq = null;