[
https://issues.apache.org/jira/browse/PHOENIX-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13903959#comment-13903959
]
Hudson commented on PHOENIX-21:
-------------------------------
SUCCESS: Integrated in Apache Phoenix - Branch:master #55 (See
[https://builds.apache.org/job/Phoenix/55/])
PHOENIX-21: Support indexes on multi-tenant views. Still needs more testing
(jamestaylor: rev e2bd0ee06b2d2982155ddcb34549fff1249f67fc)
* phoenix-core/src/main/java/org/apache/phoenix/compile/ProjectionCompiler.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/SaltingUtil.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/PDataType.java
* phoenix-core/src/main/java/org/apache/phoenix/query/QueryServices.java
*
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/PMetaDataImpl.java
* phoenix-core/src/main/java/org/apache/phoenix/query/QueryConstants.java
*
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
* phoenix-core/src/main/java/org/apache/phoenix/execute/BasicQueryPlan.java
*
phoenix-core/src/test/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataTest.java
*
phoenix-core/src/main/java/org/apache/phoenix/schema/TableAlreadyExistsException.java
*
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/QueryCompiler.java
*
phoenix-core/src/test/java/org/apache/phoenix/iterate/AggregateResultScannerTest.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/ExpressionCompiler.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/DelegateColumn.java
* phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixStatement.java
*
phoenix-core/src/main/java/org/apache/phoenix/compile/PostIndexDDLCompiler.java
*
phoenix-core/src/main/java/org/apache/phoenix/parse/CreateSequenceStatement.java
*
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServices.java
* phoenix-core/src/main/java/org/apache/phoenix/execute/HashJoinPlan.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
* phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/PColumn.java
* phoenix-core/src/main/java/org/apache/phoenix/parse/LiteralParseNode.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/PColumnImpl.java
*
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionlessQueryServicesImpl.java
*
phoenix-core/src/main/java/org/apache/phoenix/query/DelegateConnectionQueryServices.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
* phoenix-core/src/main/java/org/apache/phoenix/exception/SQLExceptionCode.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/QueryPlan.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/CreateTableCompiler.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/PostDDLCompiler.java
* phoenix-core/src/main/java/org/apache/phoenix/optimize/QueryOptimizer.java
*
phoenix-core/src/main/java/org/apache/phoenix/compile/IndexStatementRewriter.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
* phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
*
phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
* phoenix-core/src/main/java/org/apache/phoenix/util/MetaDataUtil.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
*
phoenix-core/src/test/java/org/apache/phoenix/expression/ColumnExpressionTest.java
*
phoenix-core/src/test/java/org/apache/phoenix/end2end/TenantSpecificViewIndexTest.java
* phoenix-core/src/test/java/org/apache/phoenix/end2end/ViewTest.java
* phoenix-core/src/main/java/org/apache/phoenix/schema/PTable.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
> Support indexes on multi-tenant views
> -------------------------------------
>
> Key: PHOENIX-21
> URL: https://issues.apache.org/jira/browse/PHOENIX-21
> Project: Phoenix
> Issue Type: Bug
> Reporter: James Taylor
> Assignee: James Taylor
> Attachments: tenant-specific-index-2.patch,
> tenant-specific-indexes.patch
>
>
> Current plan is to create a sibling index table based on the base
> multi-tenant table, suffixed with _INDEX when the base table is created. If
> your interested in this feature, best to review the following documents first:
> http://phoenix.incubator.apache.org/views.html
> http://phoenix.incubator.apache.org/multi-tenancy.html
> In addition, we need a multi-tenant sequence, again based on the multi-tenant
> table name suffixed with _SEQ. The base columns in this table would be: the
> first column from the base table (i.e. the tenant ID column) followed by
> index id SMALLINT. This index ID is required to ensure that data from
> different indexes on the same multi-tenant table don't intermix with each
> other (as the rest of the PK is specific to the index being added). The index
> ID would be based on the next value in the _SEQ (a multi-tenant sequence).
> For simplicity, make it two bytes, starting with Short.MIN_VALUE. We'll never
> reuse an ID, so this gives us 64K create/drop indexes per multi-tenant base
> table. The rest of the PK columns would depend on the index being created,
> and would include in this order:
> <any constant columns (think key-prefix here) from your updatable view>
> <the indexed columns from the create index statement>
> <the rest of the PK columns from the data table - standard logic here>
> The changes necessary to support this include:
> 1. Tracking the constant value referenced on a column for an updatable view
> in PColumn. Might as well track if a column is referenced by a view as well.
> Two new columns: IS_REFERENCED_BY_VIEW, CONSTANT_VALUE_IN_VIEW. For the IS
> NULL case, we can use an empty byte array to differentiate from a null. These
> values would be passed through the CreateTableCompiler and upserted with the
> rest of the data.
> 2. Disallow the removal of any column in a view that is referenced in the
> view statement. An alternative would be to invalidate the view.
> 3. Add a new INDEX_ID column to PTable specifically for an INDEX on a VIEW.
> This will get populated based on the next value in the sequence.
> 4. Push the CONSTANT_VALUE_IN_VIEW into the IndexMaintainer along with the
> tenantId and the index ID. These values will be used to form the Put(s) and
> Delete(s) that get formed when an index is maintained.
> 5. Modify the code that automatically prepends tenant_id to also prepend the
> index ID in the case. This will be in WhereOptimizer, UpsertCompiler, and
> DeleteCompiler.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)