You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ty...@apache.org on 2015/01/20 18:41:09 UTC

[1/2] cassandra git commit: Fix missing results in 2i queries on collections with filtering

Repository: cassandra
Updated Branches:
  refs/heads/trunk 6f51e35f5 -> a792a7bae


Fix missing results in 2i queries on collections with filtering

Patch by Benjamin Lerer; reviewed by Tyler Hobbs for CASSANDRA-8421


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2445d4d0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2445d4d0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2445d4d0

Branch: refs/heads/trunk
Commit: 2445d4d09f24c266075617fc5a572415e07045fc
Parents: 5a84976
Author: blerer <b_...@hotmail.com>
Authored: Tue Jan 20 11:39:30 2015 -0600
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Tue Jan 20 11:39:30 2015 -0600

----------------------------------------------------------------------
 CHANGES.txt                                       |  2 ++
 .../db/index/composites/CompositesSearcher.java   |  1 +
 .../cassandra/cql3/ContainsRelationTest.java      | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2445d4d0/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 695ae6f..1b14c62 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.1.3
+ * Fix missing results in secondary index queries on collections
+   with ALLOW FILTERING (CASSANDRA-8421)
  * Expose EstimatedHistogram metrics for range slices (CASSANDRA-8627)
  * (cqlsh) Escape clqshrc passwords properly (CASSANDRA-8618)
  * Fix NPE when passing wrong argument in ALTER TABLE statement (CASSANDRA-8355)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2445d4d0/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
index 8cc8aa8..3e523f4 100644
--- a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
@@ -219,6 +219,7 @@ public class CompositesSearcher extends SecondaryIndexSearcher
                         {
                             DecoratedKey previousKey = currentKey;
                             currentKey = dk;
+                            previousPrefix = null;
 
                             // We're done with the previous row, return it if it had data, continue otherwise
                             indexCells.addFirst(cell);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2445d4d0/test/unit/org/apache/cassandra/cql3/ContainsRelationTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/ContainsRelationTest.java b/test/unit/org/apache/cassandra/cql3/ContainsRelationTest.java
index 335636b..b51a639 100644
--- a/test/unit/org/apache/cassandra/cql3/ContainsRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/ContainsRelationTest.java
@@ -76,6 +76,24 @@ public class ContainsRelationTest extends CQLTester
     }
 
     @Test
+    public void testListContainsWithFiltering() throws Throwable
+    {
+        createTable("CREATE TABLE %s (e int PRIMARY KEY, f list<text>, s int)");
+        createIndex("CREATE INDEX ON %s(f)");
+        for(int i = 0; i < 3; i++)
+        {
+            execute("INSERT INTO %s (e, f, s) VALUES (?, ?, ?)", i, list("Dubai"), 4);
+        }
+        for(int i = 3; i < 5; i++)
+        {
+            execute("INSERT INTO %s (e, f, s) VALUES (?, ?, ?)", i, list("Dubai"), 3);
+        }
+        assertRows(execute("SELECT * FROM %s WHERE f CONTAINS ? AND s=? allow filtering", "Dubai", 3),
+                   row(3, list("Dubai"), 3),
+                   row(4, list("Dubai"), 3));
+    }
+
+    @Test
     public void testMapKeyContains() throws Throwable
     {
         createTable("CREATE TABLE %s (account text, id int, categories map<text,text>, PRIMARY KEY (account, id))");


[2/2] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

Posted by ty...@apache.org.
Merge branch 'cassandra-2.1' into trunk

Conflicts:
	CHANGES.txt


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a792a7ba
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a792a7ba
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a792a7ba

Branch: refs/heads/trunk
Commit: a792a7bae437decb2b2772153413f4a8e6c86e59
Parents: 6f51e35 2445d4d
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Tue Jan 20 11:40:59 2015 -0600
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Tue Jan 20 11:40:59 2015 -0600

----------------------------------------------------------------------
 CHANGES.txt                                       |  3 +++
 .../db/index/composites/CompositesSearcher.java   |  1 +
 .../cassandra/cql3/ContainsRelationTest.java      | 18 ++++++++++++++++++
 3 files changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a792a7ba/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 32a8846,1b14c62..5e09785
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,58 -1,7 +1,61 @@@
 +3.0
 + * Make CassandraException unchecked, extend RuntimeException (CASSANDRA-8560)
 + * Support direct buffer decompression for reads (CASSANDRA-8464)
 + * DirectByteBuffer compatible LZ4 methods (CASSANDRA-7039)
 + * Add role based access control (CASSANDRA-7653)
 + * Group sstables for anticompaction correctly (CASSANDRA-8578)
 + * Add ReadFailureException to native protocol, respond
 +   immediately when replicas encounter errors while handling
 +   a read request (CASSANDRA-7886)
 + * Switch CommitLogSegment from RandomAccessFile to nio (CASSANDRA-8308)
 + * Allow mixing token and partition key restrictions (CASSANDRA-7016)
 + * Support index key/value entries on map collections (CASSANDRA-8473)
 + * Modernize schema tables (CASSANDRA-8261)
 + * Support for user-defined aggregation functions (CASSANDRA-8053)
 + * Fix NPE in SelectStatement with empty IN values (CASSANDRA-8419)
 + * Refactor SelectStatement, return IN results in natural order instead
 +   of IN value list order (CASSANDRA-7981)
 + * Support UDTs, tuples, and collections in user-defined
 +   functions (CASSANDRA-7563)
 + * Fix aggregate fn results on empty selection, result column name,
 +   and cqlsh parsing (CASSANDRA-8229)
 + * Mark sstables as repaired after full repair (CASSANDRA-7586)
 + * Extend Descriptor to include a format value and refactor reader/writer
 +   APIs (CASSANDRA-7443)
 + * Integrate JMH for microbenchmarks (CASSANDRA-8151)
 + * Keep sstable levels when bootstrapping (CASSANDRA-7460)
 + * Add Sigar library and perform basic OS settings check on startup (CASSANDRA-7838)
 + * Support for aggregation functions (CASSANDRA-4914)
 + * Remove cassandra-cli (CASSANDRA-7920)
 + * Accept dollar quoted strings in CQL (CASSANDRA-7769)
 + * Make assassinate a first class command (CASSANDRA-7935)
 + * Support IN clause on any clustering column (CASSANDRA-4762)
 + * Improve compaction logging (CASSANDRA-7818)
 + * Remove YamlFileNetworkTopologySnitch (CASSANDRA-7917)
 + * Do anticompaction in groups (CASSANDRA-6851)
 + * Support user-defined functions (CASSANDRA-7395, 7526, 7562, 7740, 7781, 7929,
 +   7924, 7812, 8063, 7813, 7708)
 + * Permit configurable timestamps with cassandra-stress (CASSANDRA-7416)
 + * Move sstable RandomAccessReader to nio2, which allows using the
 +   FILE_SHARE_DELETE flag on Windows (CASSANDRA-4050)
 + * Remove CQL2 (CASSANDRA-5918)
 + * Add Thrift get_multi_slice call (CASSANDRA-6757)
 + * Optimize fetching multiple cells by name (CASSANDRA-6933)
 + * Allow compilation in java 8 (CASSANDRA-7028)
 + * Make incremental repair default (CASSANDRA-7250)
 + * Enable code coverage thru JaCoCo (CASSANDRA-7226)
 + * Switch external naming of 'column families' to 'tables' (CASSANDRA-4369) 
 + * Shorten SSTable path (CASSANDRA-6962)
 + * Use unsafe mutations for most unit tests (CASSANDRA-6969)
 + * Fix race condition during calculation of pending ranges (CASSANDRA-7390)
 + * Fail on very large batch sizes (CASSANDRA-8011)
 + * Improve concurrency of repair (CASSANDRA-6455, 8208)
 +
 +
  2.1.3
+  * Fix missing results in secondary index queries on collections
+    with ALLOW FILTERING (CASSANDRA-8421)
+  * Expose EstimatedHistogram metrics for range slices (CASSANDRA-8627)
   * (cqlsh) Escape clqshrc passwords properly (CASSANDRA-8618)
   * Fix NPE when passing wrong argument in ALTER TABLE statement (CASSANDRA-8355)
   * Pig: Refactor and deprecate CqlStorage (CASSANDRA-8599)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a792a7ba/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a792a7ba/test/unit/org/apache/cassandra/cql3/ContainsRelationTest.java
----------------------------------------------------------------------