cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Kirillov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-11275) sstableloader fails with java.lang.IllegalArgumentException: flags is not a column defined in this metadata
Date Mon, 29 Feb 2016 14:37:18 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-11275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15171922#comment-15171922
] 

Sergey Kirillov commented on CASSANDRA-11275:
---------------------------------------------

here is my ugly patch to work around this bug

{code}
diff --git a/src/java/org/apache/cassandra/utils/NativeSSTableLoaderClient.java b/src/java/org/apache/cassandra/utils/NativeSSTableLoaderClient.java
index 225e453..335d3a7 100644
--- a/src/java/org/apache/cassandra/utils/NativeSSTableLoaderClient.java
+++ b/src/java/org/apache/cassandra/utils/NativeSSTableLoaderClient.java
@@ -169,12 +169,12 @@ public class NativeSSTableLoaderClient extends SSTableLoader.Client
                                                   Types types)
     {
         UUID id = row.getUUID("id");
-        Set<CFMetaData.Flag> flags = CFMetaData.flagsFromStrings(row.getSet("flags",
String.class));
+        Set<CFMetaData.Flag> flags = isView ? Collections.emptySet() : CFMetaData.flagsFromStrings(row.getSet("flags",
String.class));
 
         boolean isSuper = flags.contains(CFMetaData.Flag.SUPER);
         boolean isCounter = flags.contains(CFMetaData.Flag.COUNTER);
         boolean isDense = flags.contains(CFMetaData.Flag.DENSE);
-        boolean isCompound = flags.contains(CFMetaData.Flag.COMPOUND);
+        boolean isCompound = isView ? true : flags.contains(CFMetaData.Flag.COMPOUND);
 
         String columnsQuery = String.format("SELECT * FROM %s.%s WHERE keyspace_name = ?
AND table_name = ?",
                                             SchemaKeyspace.NAME,
{code}

> sstableloader fails with java.lang.IllegalArgumentException: flags is not a column defined
in this metadata
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-11275
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11275
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>         Environment: ubuntu, cassandra 3.0.3
>            Reporter: Sergey Kirillov
>
> When used on a cluster with materialized view sstableloader fails with:
> {noformat}
> flags is not a column defined in this metadata
> java.lang.IllegalArgumentException: flags is not a column defined in this metadata
>         at com.datastax.driver.core.ColumnDefinitions.getAllIdx(ColumnDefinitions.java:272)
>         at com.datastax.driver.core.ColumnDefinitions.getFirstIdx(ColumnDefinitions.java:278)
>         at com.datastax.driver.core.ArrayBackedRow.getIndexOf(ArrayBackedRow.java:83)
>         at com.datastax.driver.core.AbstractGettableData.getSet(AbstractGettableData.java:217)
>         at org.apache.cassandra.utils.NativeSSTableLoaderClient.createTableMetadata(NativeSSTableLoaderClient.java:172)
>         at org.apache.cassandra.utils.NativeSSTableLoaderClient.fetchViews(NativeSSTableLoaderClient.java:157)
>         at org.apache.cassandra.utils.NativeSSTableLoaderClient.init(NativeSSTableLoaderClient.java:93)
>         at org.apache.cassandra.io.sstable.SSTableLoader.stream(SSTableLoader.java:159)
>         at org.apache.cassandra.tools.BulkLoader.main(BulkLoader.java:103)
> {noformat}
> This happens because there is no column `flags` in `system_schema.views`, but NativeSSTableLoaderClient
want's to read it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message