[ https://issues.apache.org/jira/browse/PHOENIX-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14581345#comment-14581345 ]
Maryann Xue commented on PHOENIX-1812: -------------------------------------- [~tdsilva] In single-table query (like no joins or subqueries), there will be exactly one TableRef instance, and the if expression will never be evaluated false. In the constructor of StatementContext, the "currentTable" is set as the first table in the resolver: {code} this.currentTable = resolver != null && !resolver.getTables().isEmpty() ? resolver.getTables().get(0) : null; {code} In a multi-table query, every participating table will be "resolved" twice because of the code you pointed out, deliberately, in order to get a SingleTableColumnResolver. This indeed is a problem, but modifying the TableRef.equals() is not the solution. A simple fix might be: {code} // Don't pass groupBy when building where clause expression, because we do not want to wrap these // expressions as group by key expressions since they're pre, not post filtered. if (innerPlan == null && !tableRef.equals(resolver.getTables().get(0))) { - context.setResolver(FromCompiler.getResolverForQuery(select, this.statement.getConnection())); + context.setResolver(FromCompiler.getResolver(tableRef)); } {code} However, I remember this change would expose some other issue in MetadataClient. > Only sync table metadata when necessary > --------------------------------------- > > Key: PHOENIX-1812 > URL: https://issues.apache.org/jira/browse/PHOENIX-1812 > Project: Phoenix > Issue Type: Sub-task > Reporter: James Taylor > Assignee: Thomas D'Silva > Attachments: PHOENIX-1812.patch, PHOENIX-1812.patch > > > With transactions, we hold the timestamp at the point when the transaction > was opened. We can prevent the MetaDataEndpoint getTable RPC in > MetaDataClient.updateCache() to check that the client has the latest table if > we've already checked at the current transaction ID timestamp. We can keep > track of which tables we've already updated in PhoenixConnection. -- This message was sent by Atlassian JIRA (v6.3.4#6332)