You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by db...@apache.org on 2018/02/06 03:42:15 UTC
[1/3] cassandra git commit: fix parameters to exception message
Repository: cassandra
Updated Branches:
refs/heads/trunk 0d26879a9 -> a8ce4b6cd
fix parameters to exception message
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/7df36056
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7df36056
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7df36056
Branch: refs/heads/trunk
Commit: 7df36056b12a13b60097b7a9a4f8155a1d02ff62
Parents: 010c477
Author: Dave Brosius <db...@mebigfatguy.com>
Authored: Mon Feb 5 22:37:50 2018 -0500
Committer: Dave Brosius <db...@mebigfatguy.com>
Committed: Mon Feb 5 22:37:50 2018 -0500
----------------------------------------------------------------------
.../apache/cassandra/cql3/statements/AlterTableStatement.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/7df36056/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
index a5fa12d..59c4e08 100644
--- a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
@@ -237,9 +237,9 @@ public class AlterTableStatement extends SchemaAlteringStatement
}
if (!Iterables.isEmpty(views))
- throw new InvalidRequestException(String.format("Cannot drop column %s on base table with materialized views.",
+ throw new InvalidRequestException(String.format("Cannot drop column %s on base table %s with materialized views.",
columnName.toString(),
- keyspace()));
+ columnFamily()));
break;
case DROP_COMPACT_STORAGE:
if (!meta.isCompactTable())
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org
[2/3] cassandra git commit: Merge branch cassandra-3.0 into
cassandra-3.11
Posted by db...@apache.org.
Merge branch cassandra-3.0 into cassandra-3.11
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/de6c62dd
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/de6c62dd
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/de6c62dd
Branch: refs/heads/trunk
Commit: de6c62dd6ce60d8493319deb05b71f90d85bc2b0
Parents: 28ee665 7df3605
Author: Dave Brosius <db...@mebigfatguy.com>
Authored: Mon Feb 5 22:40:56 2018 -0500
Committer: Dave Brosius <db...@mebigfatguy.com>
Committed: Mon Feb 5 22:40:56 2018 -0500
----------------------------------------------------------------------
.../apache/cassandra/cql3/statements/AlterTableStatement.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/de6c62dd/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
index de42647,59c4e08..12abba7
--- a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
@@@ -190,59 -192,54 +190,59 @@@ public class AlterTableStatement extend
if (!meta.isCQLTable())
throw new InvalidRequestException("Cannot drop columns from a non-CQL3 table");
- if (def == null)
- throw new InvalidRequestException(String.format("Column %s was not found in table %s", columnName, columnFamily()));
-
cfm = meta.copy();
- switch (def.kind)
+ for (AlterTableStatementColumn colData : colNameList)
{
- case PARTITION_KEY:
- case CLUSTERING:
- throw new InvalidRequestException(String.format("Cannot drop PRIMARY KEY part %s", columnName));
- case REGULAR:
- case STATIC:
- ColumnDefinition toDelete = null;
- for (ColumnDefinition columnDef : cfm.partitionColumns())
- {
- if (columnDef.name.equals(columnName))
- {
- toDelete = columnDef;
- break;
- }
- }
- assert toDelete != null;
- cfm.removeColumnDefinition(toDelete);
- cfm.recordColumnDrop(toDelete, deleteTimestamp == null ? queryState.getTimestamp() : deleteTimestamp);
- break;
- }
+ columnName = colData.getColumnName().getIdentifier(cfm);
+ def = cfm.getColumnDefinition(columnName);
- // If the dropped column is required by any secondary indexes
- // we reject the operation, as the indexes must be dropped first
- Indexes allIndexes = cfm.getIndexes();
- if (!allIndexes.isEmpty())
- {
- ColumnFamilyStore store = Keyspace.openAndGetStore(cfm);
- Set<IndexMetadata> dependentIndexes = store.indexManager.getDependentIndexes(def);
- if (!dependentIndexes.isEmpty())
- throw new InvalidRequestException(String.format("Cannot drop column %s because it has " +
- "dependent secondary indexes (%s)",
- def,
- dependentIndexes.stream()
- .map(i -> i.name)
- .collect(Collectors.joining(","))));
- }
+ if (def == null)
+ throw new InvalidRequestException(String.format("Column %s was not found in table %s", columnName, columnFamily()));
- if (!Iterables.isEmpty(views))
+ switch (def.kind)
+ {
+ case PARTITION_KEY:
+ case CLUSTERING:
+ throw new InvalidRequestException(String.format("Cannot drop PRIMARY KEY part %s", columnName));
+ case REGULAR:
+ case STATIC:
+ ColumnDefinition toDelete = null;
+ for (ColumnDefinition columnDef : cfm.partitionColumns())
+ {
+ if (columnDef.name.equals(columnName))
+ {
+ toDelete = columnDef;
+ break;
+ }
+ }
+ assert toDelete != null;
+ cfm.removeColumnDefinition(toDelete);
+ cfm.recordColumnDrop(toDelete, deleteTimestamp == null ? queryState.getTimestamp() : deleteTimestamp);
+ break;
+ }
+
+ // If the dropped column is required by any secondary indexes
+ // we reject the operation, as the indexes must be dropped first
+ Indexes allIndexes = cfm.getIndexes();
+ if (!allIndexes.isEmpty())
+ {
+ ColumnFamilyStore store = Keyspace.openAndGetStore(cfm);
+ Set<IndexMetadata> dependentIndexes = store.indexManager.getDependentIndexes(def);
+ if (!dependentIndexes.isEmpty())
+ throw new InvalidRequestException(String.format("Cannot drop column %s because it has " +
+ "dependent secondary indexes (%s)",
+ def,
+ dependentIndexes.stream()
+ .map(i -> i.name)
+ .collect(Collectors.joining(","))));
+ }
+
+ if (!Iterables.isEmpty(views))
- throw new InvalidRequestException(String.format("Cannot drop column %s on base table with materialized views.",
+ throw new InvalidRequestException(String.format("Cannot drop column %s on base table %s with materialized views.",
- columnName.toString(),
- columnFamily()));
+ columnName.toString(),
- keyspace()));
++ columnFamily()));
+ }
break;
case DROP_COMPACT_STORAGE:
if (!meta.isCompactTable())
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org
[3/3] cassandra git commit: Merge branch 'cassandra-3.11' into trunk
Posted by db...@apache.org.
Merge branch 'cassandra-3.11' into trunk
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a8ce4b6c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a8ce4b6c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a8ce4b6c
Branch: refs/heads/trunk
Commit: a8ce4b6cd801f55d01a7400c9455220b47390d40
Parents: 0d26879 de6c62d
Author: Dave Brosius <db...@mebigfatguy.com>
Authored: Mon Feb 5 22:41:39 2018 -0500
Committer: Dave Brosius <db...@mebigfatguy.com>
Committed: Mon Feb 5 22:41:39 2018 -0500
----------------------------------------------------------------------
.../apache/cassandra/cql3/statements/AlterTableStatement.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8ce4b6c/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
index e6d997e,12abba7..1561c74
--- a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
@@@ -216,16 -236,20 +216,16 @@@ public class AlterTableStatement extend
dependentIndexes.stream()
.map(i -> i.name)
.collect(Collectors.joining(","))));
+ }
}
+
if (!Iterables.isEmpty(views))
- throw new InvalidRequestException(String.format("Cannot drop column %s on base table with materialized views.",
+ throw new InvalidRequestException(String.format("Cannot drop column %s on base table %s with materialized views.",
columnName.toString(),
- keyspace()));
+ columnFamily()));
}
break;
- case DROP_COMPACT_STORAGE:
- if (!meta.isCompactTable())
- throw new InvalidRequestException("Cannot DROP COMPACT STORAGE on table without COMPACT STORAGE");
-
- cfm = meta.asNonCompact();
- break;
case OPTS:
if (attrs == null)
throw new InvalidRequestException("ALTER TABLE WITH invoked, but no parameters found");
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org