cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adelap...@apache.org
Subject [1/3] cassandra git commit: Forbid unsupported creation of SASI indexes over partition key columns (CASSANDRA-13228)
Date Wed, 10 May 2017 09:16:02 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.11 1a83efe20 -> fbf14a5eb
  refs/heads/trunk 981e3b3c7 -> 619954cd5


Forbid unsupported creation of SASI indexes over partition key columns (CASSANDRA-13228)


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

Branch: refs/heads/cassandra-3.11
Commit: fbf14a5ebde737eff3b4e6c06ddfb6a4652a6c77
Parents: 1a83efe
Author: adelapena <a.penya.garcia@gmail.com>
Authored: Tue Apr 11 17:18:17 2017 +0100
Committer: adelapena <a.penya.garcia@gmail.com>
Committed: Wed May 10 10:09:00 2017 +0100

----------------------------------------------------------------------
 CHANGES.txt                                              |  1 +
 src/java/org/apache/cassandra/index/sasi/SASIIndex.java  |  3 +++
 .../org/apache/cassandra/index/sasi/SASIIndexTest.java   | 11 +++++++++++
 3 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fbf14a5e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 3166780..c66d11b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.11.0
+ * Forbid unsupported creation of SASI indexes over partition key columns (CASSANDRA-13228)
  * Reject multiple values for a key in CQL grammar. (CASSANDRA-13369)
  * UDA fails without input rows (CASSANDRA-13399)
  * Fix compaction-stress by using daemonInitialization (CASSANDRA-13188)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fbf14a5e/src/java/org/apache/cassandra/index/sasi/SASIIndex.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/index/sasi/SASIIndex.java b/src/java/org/apache/cassandra/index/sasi/SASIIndex.java
index 4375964..f127748 100644
--- a/src/java/org/apache/cassandra/index/sasi/SASIIndex.java
+++ b/src/java/org/apache/cassandra/index/sasi/SASIIndex.java
@@ -137,6 +137,9 @@ public class SASIIndex implements Index, INotificationConsumer
         if (target.left.isComplex())
             throw new ConfigurationException("complex columns are not yet supported by SASI");
 
+        if (target.left.isPartitionKey())
+            throw new ConfigurationException("partition key columns are not yet supported
by SASI");
+
         IndexMode.validateAnalyzer(options);
 
         IndexMode mode = IndexMode.getMode(target.left, options);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fbf14a5e/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java b/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java
index 37d1961..a6ce08b 100644
--- a/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java
+++ b/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java
@@ -1930,6 +1930,17 @@ public class SASIIndexTest
 
         try
         {
+            // unsupported partition key column
+            SASIIndex.validateOptions(Collections.singletonMap("target", "id"), store.metadata);
+            Assert.fail();
+        }
+        catch (ConfigurationException e)
+        {
+            Assert.assertTrue(e.getMessage().contains("partition key columns are not yet
supported by SASI"));
+        }
+
+        try
+        {
             // invalid index mode
             SASIIndex.validateOptions(new HashMap<String, String>()
                                       {{ put("target", "address"); put("mode", "NORMAL");
}},


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message