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 6217E200CA9 for ; Fri, 16 Jun 2017 18:13:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 60B7E160BD2; Fri, 16 Jun 2017 16:13:07 +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 A72A2160BDD for ; Fri, 16 Jun 2017 18:13:06 +0200 (CEST) Received: (qmail 99030 invoked by uid 500); 16 Jun 2017 16:13: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 99019 invoked by uid 99); 16 Jun 2017 16:13:05 -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; Fri, 16 Jun 2017 16:13:05 +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 6DA191A04DB for ; Fri, 16 Jun 2017 16:13:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Zsbz7GA-YU9W for ; Fri, 16 Jun 2017 16:13:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 851A65F5B8 for ; Fri, 16 Jun 2017 16:13:02 +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 466DDE0DB7 for ; Fri, 16 Jun 2017 16:13:01 +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 263722400A for ; Fri, 16 Jun 2017 16:13:00 +0000 (UTC) Date: Fri, 16 Jun 2017 16:13:00 +0000 (UTC) From: "Aman Jha (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (PHOENIX-3952) "Ambiguous or non-equi join condition specified" Exception thrown for usage of OR expression in join conditions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 16 Jun 2017 16:13:07 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-3952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16052072#comment-16052072 ] Aman Jha edited comment on PHOENIX-3952 at 6/16/17 4:12 PM: ------------------------------------------------------------ [~jamestaylor] Still getting the same error using the suggested solution. Is there any thing else I can try out? was (Author: aman.jha@zycus.com): [~jamestaylor] Still getting the same error using the suggested solution. Is there any thing else I can trying out? > "Ambiguous or non-equi join condition specified" Exception thrown for usage of OR expression in join conditions > ---------------------------------------------------------------------------------------------------------------- > > Key: PHOENIX-3952 > URL: https://issues.apache.org/jira/browse/PHOENIX-3952 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.8.1 > Environment: HBase v-1.2.4 running on CentOS 6.0, Phoenix v-4.8.1, Squirrel v-3.7 running on Windows 10 > Reporter: Aman Jha > > If I'm joining two tables, say inner join, on an OR based condition, then the following exception is thrown in Squirrel: > {color:red}Error: ERROR 217 (22017): Ambiguous or non-equi join condition specified. Consider using table list with where clause. > SQLState: 22017 > ErrorCode: 217{color} > +*TEST CASE :*+ > Create the following tables and entries : > {code:java} > CREATE TABLE IF NOT EXISTS CBL > ( > COM_CODE VARCHAR NOT NULL , > BU_CODE VARCHAR NOT NULL , > LOC_CODE VARCHAR NOT NULL > CONSTRAINT PK_CBL PRIMARY KEY (COM_CODE, BU_CODE, LOC_CODE) > ); > CREATE TABLE IF NOT EXISTS PO_TEST > ( > PO_ID VARCHAR PRIMARY KEY, > BU_ID VARCHAR , > PO_NAME VARCHAR, > C_ID VARCHAR, > LOC_ID VARCHAR > ); > upsert into PO_TEST (PO_ID, PO_NAME, C_ID, BU_ID, LOC_ID) values ('1', 'Devcast', 'C3', 'B4', 'L5'); > upsert into PO_TEST (PO_ID, PO_NAME, C_ID, BU_ID, LOC_ID) values ('2', 'Thought', 'C2', 'B1', 'L2'); > upsert into PO_TEST (PO_ID, PO_NAME, C_ID, BU_ID, LOC_ID) values ('3', 'Jabber', 'C3', 'B4', 'L1'); > upsert into PO_TEST (PO_ID, PO_NAME, C_ID, BU_ID, LOC_ID) values ('4', 'Yakijo', 'C3', 'B8', 'L9'); > upsert into PO_TEST (PO_ID, PO_NAME, C_ID, BU_ID, LOC_ID) values ('5', 'Youfeed', 'C2', 'B3', 'L4'); > upsert into PO_TEST (PO_ID, PO_NAME, C_ID, BU_ID, LOC_ID) values ('6', 'Jayo', 'C2', 'B1', 'L10'); > upsert into PO_TEST (PO_ID, PO_NAME, C_ID, BU_ID, LOC_ID) values ('7', 'Trilia', 'C1', 'B10', 'L2'); > upsert into PO_TEST (PO_ID, PO_NAME, C_ID, BU_ID, LOC_ID) values ('8', 'Podcat', 'C1', 'B3', 'L10'); > upsert into PO_TEST (PO_ID, PO_NAME, C_ID, BU_ID, LOC_ID) values ('9', 'Twitter', 'C1', 'B5', 'L8'); > upsert into PO_TEST (PO_ID, PO_NAME, C_ID, BU_ID, LOC_ID) values ('10', 'DabZ', 'C1', 'B8', 'L4'); > upsert into PO_TEST (PO_ID, PO_NAME, C_ID, BU_ID, LOC_ID) values ('11', 'DabZ', 'C1', 'B1', 'L10'); > upsert into CBL (COM_CODE,BU_CODE,LOC_CODE) values ('C1','B1','*'); > upsert into CBL (COM_CODE,BU_CODE,LOC_CODE) values ('C1','B2','L1'); > upsert into CBL (COM_CODE,BU_CODE,LOC_CODE) values ('C1','B2','L2'); > upsert into CBL (COM_CODE,BU_CODE,LOC_CODE) values ('C1','B3','L3'); > upsert into CBL (COM_CODE,BU_CODE,LOC_CODE) values ('C1','B3','L5'); > upsert into CBL (COM_CODE,BU_CODE,LOC_CODE) values ('C2','*','L1'); > upsert into CBL (COM_CODE,BU_CODE,LOC_CODE) values ('C3','*','*'); > {code} > +*Run the following query :*+ > {code:java} > SELECT * FROM po_test INNER JOIN cbl ON > ( > ( cbl.com_code = '*' OR cbl.com_code = po_test.c_id ) > AND ( cbl.bu_code = '*' OR cbl.bu_code = po_test.bu_id ) > AND ( cbl.loc_code = '*' OR cbl.loc_code = po_test.loc_id ) > ); > {code} > +*Expected O/P :*+ > {noformat} > 1 Devcast C3 B4 L5 C3 * * > 3 Jabber C3 B4 L1 C3 * * > 4 Yakijo C3 B8 L9 C3 * * > 11 DabZ C1 B1 L10 C1 B1 * > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)