cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kuku1 (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-12012) CQLSSTableWriter and composite clustering keys trigger NPE
Date Mon, 25 Jul 2016 11:23:20 GMT

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

Kuku1 commented on CASSANDRA-12012:
-----------------------------------

I ran into the same problem with Cassandra 3.0.8. Is there any easy fix that does not need
me to rebuild Cassandra from Source and then edit the lines according to [~pierz]? 
I am limited on my workstation and I can't rebuild Cassandra manually here.

Is it possible that I can swap out an existing .jar into the one that contains the changes
from Pierre? 

> CQLSSTableWriter and composite clustering keys trigger NPE
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-12012
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12012
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Streaming and Messaging
>            Reporter: Pierre N.
>            Assignee: Mahdi Mohammadi
>
> It triggers when using multiple clustering keys in the primary keys
> {code}
> package tests;
> import java.io.File;
> import org.apache.cassandra.io.sstable.CQLSSTableWriter;
> import org.apache.cassandra.config.Config;
> public class DefaultWriter {
>     
>     public static void main(String[] args) throws Exception {
>         Config.setClientMode(true);
>         
>         String createTableQuery = "CREATE TABLE ks_test.table_test ("
>         + "    pk1 int,"
>         + "    ck1 int,"
>         + "    ck2 int,"
>         + "    PRIMARY KEY ((pk1), ck1, ck2)"
>         + ");";
>         String insertQuery = "INSERT INTO ks_test.table_test(pk1, ck1, ck2) VALUES(?,?,?)";
>         
>         CQLSSTableWriter writer = CQLSSTableWriter.builder()
>             .inDirectory(Files.createTempDirectory("sst").toFile())
>             .forTable(createTableQuery)
>             .using(insertQuery)
>             .build();
>         writer.close();
>     }
> }
> {code}
> Exception : 
> {code}
> Exception in thread "main" java.lang.ExceptionInInitializerError
> 	at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:368)
> 	at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:305)
> 	at org.apache.cassandra.db.Keyspace.open(Keyspace.java:129)
> 	at org.apache.cassandra.db.Keyspace.open(Keyspace.java:106)
> 	at org.apache.cassandra.db.Keyspace.openAndGetStore(Keyspace.java:159)
> 	at org.apache.cassandra.cql3.restrictions.PrimaryKeyRestrictionSet.hasSupportingIndex(PrimaryKeyRestrictionSet.java:156)
> 	at org.apache.cassandra.cql3.restrictions.PrimaryKeyRestrictionSet.<init>(PrimaryKeyRestrictionSet.java:118)
> 	at org.apache.cassandra.cql3.restrictions.PrimaryKeyRestrictionSet.mergeWith(PrimaryKeyRestrictionSet.java:213)
> 	at org.apache.cassandra.cql3.restrictions.StatementRestrictions.addSingleColumnRestriction(StatementRestrictions.java:266)
> 	at org.apache.cassandra.cql3.restrictions.StatementRestrictions.addRestriction(StatementRestrictions.java:250)
> 	at org.apache.cassandra.cql3.restrictions.StatementRestrictions.<init>(StatementRestrictions.java:159)
> 	at org.apache.cassandra.cql3.statements.UpdateStatement$ParsedInsert.prepareInternal(UpdateStatement.java:183)
> 	at org.apache.cassandra.cql3.statements.ModificationStatement$Parsed.prepare(ModificationStatement.java:782)
> 	at org.apache.cassandra.cql3.statements.ModificationStatement$Parsed.prepare(ModificationStatement.java:768)
> 	at org.apache.cassandra.cql3.QueryProcessor.getStatement(QueryProcessor.java:505)
> 	at org.apache.cassandra.io.sstable.CQLSSTableWriter$Builder.getStatement(CQLSSTableWriter.java:508)
> 	at org.apache.cassandra.io.sstable.CQLSSTableWriter$Builder.using(CQLSSTableWriter.java:439)
> 	at tests.DefaultWriter.main(DefaultWriter.java:29)
> Caused by: java.lang.NullPointerException
> 	at org.apache.cassandra.config.DatabaseDescriptor.getFlushWriters(DatabaseDescriptor.java:1188)
> 	at org.apache.cassandra.db.ColumnFamilyStore.<clinit>(ColumnFamilyStore.java:127)
> 	... 18 more
> {code}



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

Mime
View raw message