[ 
https://issues.apache.org/jira/browse/PHOENIX-4592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas D'Silva updated PHOENIX-4592:
------------------------------------
    Attachment: PHOENIX-4592-4.x-HBase-0.98.patch

> BaseResultIterators.getStatsForParallelizationProp() should use retry looking 
> up the table without tenantId if cannot find the table using the tenantId
> -------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-4592
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4592
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Thomas D'Silva
>            Assignee: Thomas D'Silva
>            Priority: Major
>         Attachments: PHOENIX-4592-4.x-HBase-0.98.patch
>
>
> Running a query using a tenant specific connection logs the following warning 
> :
> {code}
> 2018-02-09 17:41:45,497 WARN  [main] iterate.BaseResultIterators - Unable to 
> find parent table "X" of table "X" to determine USE_STATS_FOR_PARALLELIZATION
> org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table 
> undefined. tableName=X
>       at 
> org.apache.phoenix.schema.PMetaDataImpl.getTableRef(PMetaDataImpl.java:71)
>       at 
> org.apache.phoenix.jdbc.PhoenixConnection.getTable(PhoenixConnection.java:567)
>       at 
> org.apache.phoenix.iterate.BaseResultIterators.getStatsForParallelizationProp(BaseResultIterators.java:1282)
>       at 
> org.apache.phoenix.iterate.BaseResultIterators.<init>(BaseResultIterators.java:500)
>       at 
> org.apache.phoenix.iterate.SerialIterators.<init>(SerialIterators.java:67)
>       at org.apache.phoenix.execute.ScanPlan.newIterator(ScanPlan.java:240)
>       at 
> org.apache.phoenix.execute.BaseQueryPlan.iterator(BaseQueryPlan.java:345)
>       at 
> org.apache.phoenix.execute.BaseQueryPlan.iterator(BaseQueryPlan.java:212)
>       at 
> org.apache.phoenix.execute.BaseQueryPlan.iterator(BaseQueryPlan.java:207)
>       at 
> org.apache.phoenix.execute.BaseQueryPlan.iterator(BaseQueryPlan.java:202)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:309)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:289)
>       at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:288)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:282)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1692)
>       at sqlline.Commands.execute(Commands.java:822)
>       at sqlline.Commands.sql(Commands.java:732)
>       at sqlline.SqlLine.dispatch(SqlLine.java:807)
>       at sqlline.SqlLine.begin(SqlLine.java:681)
>       at sqlline.SqlLine.start(SqlLine.java:398)
>       at sqlline.SqlLine.main(SqlLine.java:292)
> {code}
> The following code needs to be modified
> {code}
>  if (table.getType() == PTableType.INDEX && table.getParentName() != null) {
>             PhoenixConnection conn = context.getConnection();
>             String parentTableName = table.getParentName().getString();
>             try {
>                 PTable parentTable =
>                         conn.getTable(new PTableKey(conn.getTenantId(), 
> parentTableName));
>                 useStats = parentTable.useStatsForParallelization();
>                 if (useStats != null) {
>                     return useStats;
>                 }
>             } catch (TableNotFoundException e) {
>                 logger.warn("Unable to find parent table \"" + 
> parentTableName + "\" of table \""
>                         + table.getName().getString()
>                         + "\" to determine USE_STATS_FOR_PARALLELIZATION",
>                     e);
>             }
>         }
> {code}



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

Reply via email to