James Taylor created PHOENIX-2340:
-------------------------------------

             Summary: Index creation on multi tenant table causes exception if 
tenant ID column referenced
                 Key: PHOENIX-2340
                 URL: https://issues.apache.org/jira/browse/PHOENIX-2340
             Project: Phoenix
          Issue Type: Bug
            Reporter: James Taylor


If an index is attempted to be created on a multi-tenant table, an error occurs 
if the tenant ID column is referenced in the indexed columns. This is because 
it's already automatically included. However, it should not be an error if the 
user references it (as long as it's the first indexed column).

To repro:
{code}
CREATE TABLE IF NOT EXISTS T (
    ORGANIZATION_ID CHAR(15) NOT NULL,
    NETWORK_ID CHAR(15) NOT NULL,
    SUBJECT_ID CHAR(15) NOT NULL,
    RUN_ID CHAR(15) NOT NULL,
    SCORE DOUBLE,
    TOPIC_ID CHAR(15) NOT NULL
    CONSTRAINT PK PRIMARY KEY (
        ORGANIZATION_ID,
        NETWORK_ID,
        SUBJECT_ID,
        RUN_ID,
        TOPIC_ID
    )
) MULTI_TENANT=TRUE;

CREATE INDEX IDX ON T (
    ORGANIZATION_ID,
    NETWORK_ID,
    TOPIC_ID,
    RUN_ID,
    SCORE
) INCLUDE (
    SUBJECT_ID
);
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to