cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject [6/7] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.5
Date Fri, 04 Mar 2016 21:16:12 GMT
Merge branch cassandra-3.0 into cassandra-3.5


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

Branch: refs/heads/trunk
Commit: 8c83c8edab4f1c23c382bb0ac076cab44d5f4dda
Parents: a8dc14d 9c3855b
Author: Benjamin Lerer <b.lerer@gmail.com>
Authored: Fri Mar 4 22:12:33 2016 +0100
Committer: Benjamin Lerer <b.lerer@gmail.com>
Committed: Fri Mar 4 22:13:35 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |    1 +
 .../cassandra/cql3/SingleColumnRelation.java    |    4 -
 .../restrictions/StatementRestrictions.java     |   25 +-
 .../cql3/statements/SelectStatement.java        |   12 +-
 .../apache/cassandra/db/filter/RowFilter.java   |   50 +-
 .../index/internal/CassandraIndex.java          |   23 +-
 .../entities/FrozenCollectionsTest.java         |    3 +-
 .../validation/entities/SecondaryIndexTest.java |    3 +-
 .../cql3/validation/operations/DeleteTest.java  |   10 +-
 .../SelectMultiColumnRelationTest.java          |   54 +-
 .../SelectSingleColumnRelationTest.java         |   51 +-
 .../cql3/validation/operations/SelectTest.java  | 1063 +++++++++++++++++-
 .../cql3/validation/operations/UpdateTest.java  |    8 +-
 .../apache/cassandra/index/CustomIndexTest.java |    4 +-
 .../index/internal/CassandraIndexTest.java      |   34 +-
 15 files changed, 1199 insertions(+), 146 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index a6cae21,7204098..4c21d66
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,5 -1,5 +1,6 @@@
 -3.0.5
 +3.5
 +Merged from 3.0:
+  * Fix filtering on non-primary key columns for queries without index (CASSANDRA-6377)
   * Fix sstableloader fail when using materialized view (CASSANDRA-11275)
  Merged from 2.2:
   * Only log yaml config once, at startup (CASSANDRA-11217)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/src/java/org/apache/cassandra/cql3/SingleColumnRelation.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index d3a79d0,51d675b..2f4d468
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@@ -702,9 -696,8 +696,7 @@@ public class SelectStatement implement
          // we want to include static columns and we're done.
          if (!partition.hasNext())
          {
-             if (!staticRow.isEmpty()
-                 && (!restrictions.hasClusteringColumnsRestriction() || cfm.isStaticCompactTable())
-                 && !restrictions.hasRegularColumnsRestriction())
 -            if (!staticRow.isEmpty() && (!restrictions.usesSecondaryIndexing() ||
cfm.isStaticCompactTable())
 -                    && !restrictions.hasClusteringColumnsRestriction())
++            if (!staticRow.isEmpty() && (!restrictions.hasClusteringColumnsRestriction()
|| cfm.isStaticCompactTable()))
              {
                  result.newRow(protocolVersion);
                  for (ColumnDefinition def : selection.getColumns())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/src/java/org/apache/cassandra/db/filter/RowFilter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/src/java/org/apache/cassandra/index/internal/CassandraIndex.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/index/internal/CassandraIndex.java
index f503e59,74d3f5d..c3e75e0
--- a/src/java/org/apache/cassandra/index/internal/CassandraIndex.java
+++ b/src/java/org/apache/cassandra/index/internal/CassandraIndex.java
@@@ -5,12 -5,13 +5,11 @@@ import java.util.*
  import java.util.concurrent.Callable;
  import java.util.concurrent.Future;
  import java.util.function.BiFunction;
 -import java.util.regex.Matcher;
--import java.util.regex.Pattern;
  import java.util.stream.Collectors;
  import java.util.stream.StreamSupport;
  
  import com.google.common.collect.ImmutableSet;
- import org.apache.cassandra.index.TargetParser;
 -import org.apache.commons.lang3.StringUtils;
++
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
@@@ -31,9 -33,9 +30,7 @@@ import org.apache.cassandra.db.partitio
  import org.apache.cassandra.db.rows.*;
  import org.apache.cassandra.dht.LocalPartitioner;
  import org.apache.cassandra.exceptions.InvalidRequestException;
--import org.apache.cassandra.index.Index;
--import org.apache.cassandra.index.IndexRegistry;
--import org.apache.cassandra.index.SecondaryIndexBuilder;
++import org.apache.cassandra.index.*;
  import org.apache.cassandra.index.internal.composites.CompositesSearcher;
  import org.apache.cassandra.index.internal.keys.KeysSearcher;
  import org.apache.cassandra.index.transactions.IndexTransaction;
@@@ -266,7 -285,7 +278,6 @@@ public abstract class CassandraIndex im
  
          if (target.isPresent())
          {
--            target.get().validateForIndexing();
              switch (getIndexMetadata().kind)
              {
                  case COMPOSITES:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/test/unit/org/apache/cassandra/cql3/validation/entities/SecondaryIndexTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
index 8622c98,a7eeeb8..c5feccb
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
@@@ -511,18 -515,18 +515,18 @@@ public class SelectTest extends CQLTest
                     row("test", 5, map("lmn", "foo"))
          );
  
-         assertInvalidMessage("Unsupported null value for indexed column categories",
+         assertInvalidMessage("Unsupported null value for column categories",
                               "SELECT * FROM %s WHERE account = ? AND id = ? AND categories
CONTAINS ?", "test", 5, null);
  
-         assertInvalidMessage("Unsupported unset value for indexed column categories",
+         assertInvalidMessage("Unsupported unset value for column categories",
                               "SELECT * FROM %s WHERE account = ? AND id = ? AND categories
CONTAINS ?", "test", 5, unset());
  
-         assertInvalidMessage("Cannot execute this query as it might involve data filtering
and thus may have unpredictable performance. If you want to execute this query despite the
performance unpredictability, use ALLOW FILTERING",
+         assertInvalidMessage(StatementRestrictions.REQUIRES_ALLOW_FILTERING_MESSAGE,
 -                             "SELECT * FROM %s WHERE account = ? AND id = ? AND categories
CONTAINS ? AND categories CONTAINS ?",
 -                             "test", 5, "foo", "notPresent");
 +                             "SELECT * FROM %s WHERE account = ? AND id = ? AND categories
CONTAINS ? AND categories CONTAINS ?"
 +                            , "test", 5, "foo", "notPresent");
  
 -        assertEmpty(execute("SELECT * FROM %s WHERE account = ? AND id = ? AND categories
CONTAINS ? AND categories CONTAINS ? ALLOW FILTERING",
 -                            "test", 5, "foo", "notPresent"));
 +        assertEmpty(execute("SELECT * FROM %s WHERE account = ? AND id = ? AND categories
CONTAINS ? AND categories CONTAINS ? ALLOW FILTERING"
 +                           , "test", 5, "foo", "notPresent"));
      }
  
      // See CASSANDRA-7525

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/test/unit/org/apache/cassandra/cql3/validation/operations/UpdateTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/test/unit/org/apache/cassandra/index/CustomIndexTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/index/CustomIndexTest.java
index 79e94ec,b1fd992..6be0ffa
--- a/test/unit/org/apache/cassandra/index/CustomIndexTest.java
+++ b/test/unit/org/apache/cassandra/index/CustomIndexTest.java
@@@ -15,12 -15,12 +15,12 @@@ import org.apache.cassandra.config.CFMe
  import org.apache.cassandra.cql3.CQLTester;
  import org.apache.cassandra.cql3.ColumnIdentifier;
  import org.apache.cassandra.cql3.restrictions.IndexRestrictions;
+ import org.apache.cassandra.cql3.restrictions.StatementRestrictions;
  import org.apache.cassandra.cql3.statements.IndexTarget;
  import org.apache.cassandra.cql3.statements.ModificationStatement;
- import org.apache.cassandra.cql3.statements.SelectStatement;
  import org.apache.cassandra.db.ColumnFamilyStore;
  import org.apache.cassandra.db.ReadCommand;
 -import org.apache.cassandra.db.ReadOrderGroup;
 +import org.apache.cassandra.db.ReadExecutionController;
  import org.apache.cassandra.db.marshal.AbstractType;
  import org.apache.cassandra.db.marshal.Int32Type;
  import org.apache.cassandra.db.marshal.UTF8Type;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c83c8ed/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
----------------------------------------------------------------------


Mime
View raw message