Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A0F4C200B43 for ; Tue, 19 Jul 2016 09:51:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9FA35160A89; Tue, 19 Jul 2016 07:51:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E96F1160A76 for ; Tue, 19 Jul 2016 09:51:24 +0200 (CEST) Received: (qmail 36586 invoked by uid 500); 19 Jul 2016 07:51:24 -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 36572 invoked by uid 99); 19 Jul 2016 07:51:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jul 2016 07:51:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id AB0351812B0 for ; Tue, 19 Jul 2016 07:51:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id DdwX0hj-IEZz for ; Tue, 19 Jul 2016 07:51:22 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id A30295F246 for ; Tue, 19 Jul 2016 07:51:21 +0000 (UTC) Received: (qmail 36512 invoked by uid 99); 19 Jul 2016 07:51:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jul 2016 07:51:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id AAF0A2C0031 for ; Tue, 19 Jul 2016 07:51:20 +0000 (UTC) Date: Tue, 19 Jul 2016 07:51:20 +0000 (UTC) From: "James Taylor (JIRA)" To: dev@phoenix.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (PHOENIX-3042) Using functional index expression in where statement for join query fails. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 19 Jul 2016 07:51:25 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-3042?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James Taylor updated PHOENIX-3042: ---------------------------------- Fix Version/s: (was: 4.8.1) 4.8.0 > Using functional index expression in where statement for join query fails. > --------------------------------------------------------------------------- > > Key: PHOENIX-3042 > URL: https://issues.apache.org/jira/browse/PHOENIX-3042 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.8.0 > Reporter: Sergey Soldatov > Assignee: Thomas D'Silva > Fix For: 4.8.0 > > Attachments: PHOENIX-3042-V2.patch, PHOENIX-3042-v3.patch, PHOENIX-3042.patch > > > A simple scenario: > {noformat} > CREATE TABLE customer_phx ( c_customer_sk varchar primary key, c_first_name varchar, c_last_name varchar ); > UPSERT INTO customer_phx values ( '1', 'David', 'Smith'); > CREATE LOCAL INDEX CUSTINDEX ON customer_phx (c_customer_sk || c_first_name asc) include (c_customer_sk); > select c.c_customer_sk from customer_phx c left outer join customer_phx c2 on c.c_customer_sk = c2.c_customer_sk where c.c_customer_sk || c.c_first_name = '1David'; > {noformat} > It fails with an Exception : > {noformat} > Error: ERROR 504 (42703): Undefined column. columnName=C_FIRST_NAME (state=42703,code=504) > org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): Undefined column. columnName=C_FIRST_NAME > at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.resolveColumn(WhereCompiler.java:190) > at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.visit(WhereCompiler.java:169) > at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.visit(WhereCompiler.java:156) > at org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:56) > at org.apache.phoenix.parse.CompoundParseNode.acceptChildren(CompoundParseNode.java:64) > at org.apache.phoenix.parse.StringConcatParseNode.accept(StringConcatParseNode.java:46) > at org.apache.phoenix.parse.CompoundParseNode.acceptChildren(CompoundParseNode.java:64) > at org.apache.phoenix.parse.ComparisonParseNode.accept(ComparisonParseNode.java:45) > at org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:130) > at org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:100) > at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:556) > at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:324) > at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:200) > at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:157) > at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:404) > at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:378) > at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:271) > at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:266) > at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) > at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:265) > at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1444) > 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) > {noformat} > Meanwhile using the same where statement without join works just fine. > Any ideas [~jamestaylor], [~ramkrishna.s.vasudevan@gmail.com] ? -- This message was sent by Atlassian JIRA (v6.3.4#6332)