[jira] [Commented] (PHOENIX-4654) In PhoenixDatabaseMetaData.addTenantIdFilter add WHERE TENANT_ID is NULL when the connection used does not have a tenant id

2018-03-14 Thread Thomas D'Silva (JIRA)

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

Thomas D'Silva commented on PHOENIX-4654:
-

Ok that makes sense, I'll change this JIRA to add document this on the getTable 
metod().

> 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)


[jira] [Commented] (PHOENIX-4654) In PhoenixDatabaseMetaData.addTenantIdFilter add WHERE TENANT_ID is NULL when the connection used does not have a tenant id

2018-03-14 Thread James Taylor (JIRA)

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

James Taylor commented on PHOENIX-4654:
---

There's a subtle distinction in using a null tenantId and an empty string 
tenantId. The latter will do as you mention (add an IS NULL clause), but the 
former is a way to get all tenants - global and multi-tenant.

> 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)


[jira] [Commented] (PHOENIX-4654) In PhoenixDatabaseMetaData.addTenantIdFilter add WHERE TENANT_ID is NULL when the connection used does not have a tenant id

2018-03-14 Thread Thomas D'Silva (JIRA)

[ 
https://issues.apache.org/jira/browse/PHOENIX-4654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)