Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/3#discussion_r14860075
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java ---
    @@ -568,8 +629,13 @@ public MutationState createIndex(CreateIndexStatement 
statement, byte[][] splits
                         allPkColumns.add(new Pair<ColumnName, 
SortOrder>(colName, col.getSortOrder()));
                         columnDefs.add(FACTORY.columnDef(colName, 
dataType.getSqlTypeName(), col.isNullable(), col.getMaxLength(), 
col.getScale(), false, SortOrder.getDefault()));
                     }
    -                if (dataTable.getType() == PTableType.VIEW && 
dataTable.getViewType() != ViewType.MAPPED) {
    -                    allocateViewIndexId = true;
    +                /*
    +                 * Allocate an index ID in two circumstances:
    +                 * 1) for a local index, as all local indexes will reside 
in the same HBase table
    +                 * 2) for a view on an index.
    +                 */
    +                if (statement.getIndexType() == IndexType.LOCAL || 
(dataTable.getType() == PTableType.VIEW && dataTable.getViewType() != 
ViewType.MAPPED)) {
    +                    allocateIndexId = true;
    --- End diff --
    
    Add check here for if (dataTable.isImmutableRows() && 
statement.getIndexType() == IndexType.LOCAL) and just throw a SQLException with 
a new error code that local indexes aren't allowed on tables with immutable 
rows.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to