phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas D'Silva (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-4654) In PhoenixDatabaseMetaData.addTenantIdFilter add WHERE TENANT_ID is NULL when the connection used does not have a tenant id
Date Thu, 15 Mar 2018 01:46:00 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-4654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16399759#comment-16399759
] 

Thomas D'Silva commented on PHOENIX-4654:
-----------------------------------------

[~jamestaylor] 
In PhoenixDatabaseMetaData.addTenantIdFilter if the tenantIdPattern is null and the connection
being used is a global connection, should we add "TENANT_ID IS NULL" to the where clause?


{code}
private void addTenantIdFilter(StringBuilder buf, String tenantIdPattern) {
        PName tenantId = connection.getTenantId();
        if (tenantIdPattern == null) {
            if (tenantId != null) {
                appendConjunction(buf);
                buf.append(" (" + TENANT_ID + " IS NULL " +
                        " OR " + TENANT_ID + " = '" + StringUtil.escapeStringConstant(tenantId.getString())
+ "') ");
            }
        } else if (tenantIdPattern.length() == 0) {
                appendConjunction(buf);
                buf.append(TENANT_ID + " IS NULL ");
        } else {
            appendConjunction(buf);
            buf.append(" TENANT_ID LIKE '" + StringUtil.escapeStringConstant(tenantIdPattern)
+ "' ");
            if (tenantId != null) {
                buf.append(" and TENANT_ID = '" + StringUtil.escapeStringConstant(tenantId.getString())
+ "' ");
            }
        }
    }
{code}

> In PhoenixDatabaseMetaData.addTenantIdFilter add WHERE TENANT_ID is NULL when the connection
used does not have a tenant id 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-4654
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4654
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Thomas D'Silva
>            Assignee: Thomas D'Silva
>            Priority: Major
>
> or else we end up doing a full table scan



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message