From dev-return-54138-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Mon Oct 1 23:32:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E68FD180660 for ; Mon, 1 Oct 2018 23:32:05 +0200 (CEST) Received: (qmail 17096 invoked by uid 500); 1 Oct 2018 21:32:05 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 17084 invoked by uid 99); 1 Oct 2018 21:32:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2018 21:32:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 9B95F1A1BBF for ; Mon, 1 Oct 2018 21:32:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 2bMnmloFB1qc for ; Mon, 1 Oct 2018 21:32:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id AC8E45F545 for ; Mon, 1 Oct 2018 21:32:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CBB0FE262F for ; Mon, 1 Oct 2018 21:32:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4D37527766 for ; Mon, 1 Oct 2018 21:32:00 +0000 (UTC) Date: Mon, 1 Oct 2018 21:32:00 +0000 (UTC) From: "Lars Hofhansl (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (PHOENIX-4938) SELECT compilation failure when a local index is present MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PHOENIX-4938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lars Hofhansl updated PHOENIX-4938: ----------------------------------- Description: {{create table test (pk integer primary key, v1 float, v2 float, v3 integer);}} {{create local index local1 on test(v2);}} Now {{select count\(*) from test t1, test t2 where t1.v1 = t2.v1 and t2.v2 < 0.001;}} will throw {code} Error: ERROR 1012 (42M03): Table undefined. tableName=T2 (state=42M03,code=1012) org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=T2 at org.apache.phoenix.compile.FromCompiler$MultiTableColumnResolver.resolveTable(FromCompiler.java:869) at org.apache.phoenix.compile.FromCompiler$ProjectedTableColumnResolver.resolveColumn(FromCompiler.java:1029) at org.apache.phoenix.compile.ExpressionCompiler.resolveColumn(ExpressionCompiler.java:372) at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.resolveColumn(ProjectionCompiler.java:621) at org.apache.phoenix.compile.ExpressionCompiler.visit(ExpressionCompiler.java:408) at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visit(ProjectionCompiler.java:628) at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visit(ProjectionCompiler.java:585) at org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:56) at org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:412) at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:564) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:219) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:295) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:230) at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:193) at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:155) at org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlans(QueryOptimizer.java:189) at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:111) at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:97) at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:309) at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:291) at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:290) at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:283) at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1830) at sqlline.Commands.execute(Commands.java:822) {code} This will not happen when there is no local index defined. was: {{create table test (pk integer primary key, v1 float, v2 float, v3 integer);}} {{create local index local1 on test(v2);}} Now {{select count(*) from test t1, test t2 where t1.v1 = t2.v1 and t2.v2 < 0.001;}} will throw {code} Error: ERROR 1012 (42M03): Table undefined. tableName=T2 (state=42M03,code=1012) org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=T2 at org.apache.phoenix.compile.FromCompiler$MultiTableColumnResolver.resolveTable(FromCompiler.java:869) at org.apache.phoenix.compile.FromCompiler$ProjectedTableColumnResolver.resolveColumn(FromCompiler.java:1029) at org.apache.phoenix.compile.ExpressionCompiler.resolveColumn(ExpressionCompiler.java:372) at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.resolveColumn(ProjectionCompiler.java:621) at org.apache.phoenix.compile.ExpressionCompiler.visit(ExpressionCompiler.java:408) at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visit(ProjectionCompiler.java:628) at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visit(ProjectionCompiler.java:585) at org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:56) at org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:412) at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:564) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:219) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:295) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:230) at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:193) at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:155) at org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlans(QueryOptimizer.java:189) at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:111) at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:97) at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:309) at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:291) at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:290) at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:283) at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1830) at sqlline.Commands.execute(Commands.java:822) {code} This will not happen when there is no local index defined. > SELECT compilation failure when a local index is present > -------------------------------------------------------- > > Key: PHOENIX-4938 > URL: https://issues.apache.org/jira/browse/PHOENIX-4938 > Project: Phoenix > Issue Type: Improvement > Reporter: Lars Hofhansl > Priority: Major > > {{create table test (pk integer primary key, v1 float, v2 float, v3 integer);}} > {{create local index local1 on test(v2);}} > Now > {{select count\(*) from test t1, test t2 where t1.v1 = t2.v1 and t2.v2 < 0.001;}} > will throw > {code} > Error: ERROR 1012 (42M03): Table undefined. tableName=T2 (state=42M03,code=1012) > org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=T2 > at org.apache.phoenix.compile.FromCompiler$MultiTableColumnResolver.resolveTable(FromCompiler.java:869) > at org.apache.phoenix.compile.FromCompiler$ProjectedTableColumnResolver.resolveColumn(FromCompiler.java:1029) > at org.apache.phoenix.compile.ExpressionCompiler.resolveColumn(ExpressionCompiler.java:372) > at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.resolveColumn(ProjectionCompiler.java:621) > at org.apache.phoenix.compile.ExpressionCompiler.visit(ExpressionCompiler.java:408) > at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visit(ProjectionCompiler.java:628) > at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visit(ProjectionCompiler.java:585) > at org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:56) > at org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:412) > at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:564) > at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:219) > at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:295) > at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:230) > at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:193) > at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:155) > at org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlans(QueryOptimizer.java:189) > at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:111) > at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:97) > at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:309) > at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:291) > at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) > at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:290) > at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:283) > at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1830) > at sqlline.Commands.execute(Commands.java:822) > {code} > This will not happen when there is no local index defined. -- This message was sent by Atlassian JIRA (v7.6.3#76005)