[
https://issues.apache.org/jira/browse/PHOENIX-3445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15707221#comment-15707221
]
James Taylor commented on PHOENIX-3445:
---------------------------------------
Thanks for the patch, [~tdsilva]. Here's some feedback:
- For this, I think we'd want to transfer over the dataTable.isImmutableRows()
for the index instead of passing null as if the data table is immutable, so are
the indexes:
{code}
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 ecd5f7a..b424e3e 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
@@ -1424,7 +1424,7 @@ public class MetaDataClient {
statement.getProps().put("", new
Pair<String,Object>(DEFAULT_COLUMN_FAMILY_NAME,dataTable.getDefaultFamilyName().getString()));
}
PrimaryKeyConstraint pk = FACTORY.primaryKey(null,
allPkColumns);
- CreateTableStatement tableStatement =
FACTORY.createTable(indexTableName, statement.getProps(), columnDefs, pk,
statement.getSplitNodes(), PTableType.INDEX, statement.ifNotExists(), null,
null, statement.getBindCount());
+ CreateTableStatement tableStatement =
FACTORY.createTable(indexTableName, statement.getProps(), columnDefs, pk,
statement.getSplitNodes(), PTableType.INDEX, statement.ifNotExists(), null,
null, statement.getBindCount(), null);
table = createTableInternal(tableStatement, splits, dataTable,
null, null, null, null, allocateIndexId, statement.getIndexType(),
asyncCreatedDate, tableProps, commonFamilyProps);
break;
} catch (ConcurrentTableMutationException e) { // Can happen if
parent data table changes while above is in progress
{code}
- We need to update our validation logic too. I think we should no longer allow
the immutability of a table to change in an ALTER TABLE statement. We could
optionally allow it, but only if the storage scheme is 0 bytes (i.e. column
encoding is not being used). Probably simpler if we just disallow it
altogether. We should deprecate the IMMUTABLE_ROWS property too and at our next
major release only support the IMMUTABLE keyword as the way to specify a table
being immutable.
- Also (and maybe Samarth already did this?), we'll need to make sure you can
only specify the number of bytes for the column qualifier at creation time.
> Add a CREATE IMMUTABLE TABLE construct to make immutable tables more explicit
> -----------------------------------------------------------------------------
>
> Key: PHOENIX-3445
> URL: https://issues.apache.org/jira/browse/PHOENIX-3445
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Samarth Jain
> Assignee: Thomas D'Silva
> Attachments: PHOENIX-3445.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)