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 1FF28200B2F for ; Sun, 3 Jul 2016 21:08:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1E816160A6B; Sun, 3 Jul 2016 19:08:13 +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 65FB0160A71 for ; Sun, 3 Jul 2016 21:08:12 +0200 (CEST) Received: (qmail 68655 invoked by uid 500); 3 Jul 2016 19:08:11 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 68515 invoked by uid 99); 3 Jul 2016 19:08:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jul 2016 19:08:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1C2182C02A3 for ; Sun, 3 Jul 2016 19:08:11 +0000 (UTC) Date: Sun, 3 Jul 2016 19:08:11 +0000 (UTC) From: "Alex Petrov (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CASSANDRA-12128) Unexpected amount of returned results after querying SASI index MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 03 Jul 2016 19:08:13 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-12128?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Petrov resolved CASSANDRA-12128. ------------------------------------- Resolution: Invalid > Unexpected amount of returned results after querying SASI index > --------------------------------------------------------------- > > Key: CASSANDRA-12128 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12128 > Project: Cassandra > Issue Type: Bug > Reporter: Alex Petrov > > I'm working on [CASSANDRA-11990] and one of the unit tests started failing after the changes I've made. However, it seems that the results returned on {{trunk}} are incorrect. > One can reproduce it with the following code: > {code} > @Test > public void testCrossSSTableQueries2() throws Exception > { > Map> part1 = new HashMap>() > {{ > put("key0", Pair.create("Maxie", 43)); > put("key1", Pair.create("Chelsie", 33)); > put("key2", Pair.create("Josephine", 43)); > put("key3", Pair.create("Shanna", 27)); > put("key4", Pair.create("Amiya", 36)); > }}; > loadData(part1, true); // first sstable > Map> part2 = new HashMap>() > {{ > put("key5", Pair.create("Americo", 20)); > put("key6", Pair.create("Fiona", 39)); > put("key7", Pair.create("Francis", 41)); > put("key8", Pair.create("Charley", 21)); > put("key9", Pair.create("Amely", 40)); > }}; > loadData(part2, true); > Map> part3 = new HashMap>() > {{ > put("key10", Pair.create("Eddie", 42)); > put("key11", Pair.create("Oswaldo", 35)); > put("key12", Pair.create("Susana", 35)); > put("key13", Pair.create("Alivia", 42)); > put("key14", Pair.create("Demario", 28)); > }}; > ColumnFamilyStore store = loadData(part3, true); > final ByteBuffer firstName = UTF8Type.instance.decompose("first_name"); > Set rows; > rows = getIndexed(store, 10, > buildExpression(firstName, Operator.LIKE_SUFFIX, UTF8Type.instance.decompose("a"))); > Map> concat = new HashMap<>(); > concat.putAll(part1); > concat.putAll(part2); > concat.putAll(part3); > Set keys = new HashSet<>(); > concat.forEach((k, v) -> { > int idx = v.left.indexOf('a'); > if (idx > 0) > { > keys.add(k); > } > }); > System.out.println("keys = " + keys); > String[] arr = new String[keys.size()]; > keys.toArray(arr); > Assert.assertTrue(rows.toString(), Arrays.equals(arr, rows.toArray(new String[rows.size()]))); > } > {code} > Expected results are (emphasis mine) > {code} > [key14, key13, key0, key12, key6, key3, key4, key7, key8, key11] > "key14" "Dem_a_rio" > "key13" "Alivi_a_" > "key0" "M_a_xie" > "key12" "Sus_a_na" > "key6" "Fion_a_" > "key3" "Sh_a_nna" > "key4" "Amiy_a_" > "key7" "Fr_a_ncis" > "key8" "Ch_a_rley" > "key11" "Osw_a_ldo" > {code} > although returned are > {code} > [key12, key13, key3, key4, key6] > {code} > cc [~xedin] [~doanduyhai] [~beobal] -- This message was sent by Atlassian JIRA (v6.3.4#6332)