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 BC5DA200D1B for ; Thu, 28 Sep 2017 00:44:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BAB871609EB; Wed, 27 Sep 2017 22:44:04 +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 0ABCE1609CA for ; Thu, 28 Sep 2017 00:44:03 +0200 (CEST) Received: (qmail 54128 invoked by uid 500); 27 Sep 2017 22:44:03 -0000 Mailing-List: contact issues-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list issues@geode.apache.org Received: (qmail 54119 invoked by uid 99); 27 Sep 2017 22:44:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Sep 2017 22:44:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id BA27FCD206 for ; Wed, 27 Sep 2017 22:44:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id fwkG474KpBZT for ; Wed, 27 Sep 2017 22:44: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 9B3E35F3F5 for ; Wed, 27 Sep 2017 22:44: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 0F0E1E0B20 for ; Wed, 27 Sep 2017 22:44: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 BF44E24286 for ; Wed, 27 Sep 2017 22:44:00 +0000 (UTC) Date: Wed, 27 Sep 2017 22:44:00 +0000 (UTC) From: "nabarun (JIRA)" To: issues@geode.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (GEODE-3707) Join queries with two join conditions return duplicate results when executed with indexes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 27 Sep 2017 22:44:04 -0000 [ https://issues.apache.org/jira/browse/GEODE-3707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] nabarun closed GEODE-3707. -------------------------- > Join queries with two join conditions return duplicate results when executed with indexes > ----------------------------------------------------------------------------------------- > > Key: GEODE-3707 > URL: https://issues.apache.org/jira/browse/GEODE-3707 > Project: Geode > Issue Type: Bug > Components: querying > Reporter: nabarun > Fix For: 1.3.0 > > > Acceptance: the test below must return the same number of results > {code: title = Customer.java} > public static class Customer implements Serializable { > public int pkid; > public int id; > public int joinId; > public String name; > public Map nested = new HashMap(); > public Customer(int pkid, int id) { > this.pkid = pkid; > this.id = id; > this.joinId = id; > this.name = "name" + pkid; > } > public Customer(int pkid, int id, int joinId) { > this.pkid = pkid; > this.id = id; > this.joinId = joinId; > this.name = "name" + pkid; > } > public String toString() { > return "Customer pkid = " + pkid + ", id: " + id + " name:" + name; > } > } > {code} > {code: title = Test.java} > @Test > public void testJoinTwoRegions(/*String queryString, int resultSize*/) throws Exception { > Cache cache = getCache(); > Region region1 = > cache.createRegionFactory().setDataPolicy(DataPolicy.REPLICATE).create("region1"); > Region region2 = > cache.createRegionFactory().setDataPolicy(DataPolicy.REPLICATE).create("region2"); > for (int i = 1; i < 11; i++) { > region1.put(i, new EquiJoinIntegrationTest.Customer(i, i, i)); > if(i == 1 || i == 4 || i == 7 || i == 10){ > region2.put(i, new EquiJoinIntegrationTest.Customer(1, 1, 1)); > }else { > region2.put(i, new EquiJoinIntegrationTest.Customer(i % 5, i, i % 3)); > } > String queryString = "select STA.id as STACID, STA.pkid as STAacctNum, STC.id as STCCID, STC.pkid as STCacctNum from /region1 STA, /region2 STC where STA.pkid = 1 AND STA.joinId = STC.joinId or STA.id = STC.id"; > int resultSize = 1; > QueryService queryService = cache.getQueryService(); > SelectResults results = (SelectResults) queryService.newQuery(queryString).execute(); > int resultSizeWithoutIndex = results.size(); > > queryService.createIndex("pkidregion1", "p.pkid", "/region1 p"); > queryService.createIndex("pkidregion2", "p.pkid", "/region2 p"); > queryService.createIndex("indexIDRegion2","p.id", "/region2 p"); > queryService.createIndex("indexIDRegion1","p.id", "/region1 p"); > queryService.createIndex("joinIdregion1", "p.joinId", "/region1 p"); > queryService.createIndex("joinIdregion2", "p.joinId", "/region2 p"); > queryService.createIndex("nameIndex", "p.name", "/region2 p"); > results = (SelectResults) queryService.newQuery(queryString).execute(); > int resultSizeWithIndex = results.size(); > assertEquals(resultSizeWithIndex, resultSizeWithoutIndex); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)