QnaList > Groups > Cassandra-User > Jan 2014
faq

Problem In Running Cassandra-2.0.4 Trigger Example

I am new to cassandra and trying to run the trigger example provided by
cassandra on a pseudo cluster using instructions provided on
https://github.com/apache/cassandra/tree/cassandra-2.0/examples/triggers
But i am getting error:   *Bad Request: Key may not be empty*
Can someone tell me if my "CREATE table" is proper? What else can be wrong?
I am doing following using cqlsh.
   - CREATE KEYSPACE keyspace1 WITH REPLICATION = { 'class' :
   'SimpleStrategy', 'replication_factor' : 1 };
   - use keyspace1;
   - CREATE TABLE invertedindex ( f1 varchar , f2 varchar, f3 varchar,
   PRIMARY KEY(f1));
   - CREATE TABLE table1 ( f1 varchar , f2 varchar, f3 varchar, PRIMARY
   KEY(f1));
   - CREATE TRIGGER mytrigger ON table1 USING
   'org.apache.cassandra.triggers.InvertedIndex';
   - insert into table1 (f1,f2,f3) values ('aaa','bbb','ccc');
This is what i get in system.log:
*INFO  [Thrift:1] 2014-01-11 14:48:09,875 InvertedIndex.java:67 - loaded
property file, InvertedIndex.properties*
This is content of conf/InvertedIndex.properties file:
*keyspace=keyspace1*
*columnfamily=invertedindex*
Thanks in advance.
Vidit

asked Jan 11 2014 at 12:03

Vidit Asthana 's gravatar image



2 Replies for : Problem In Running Cassandra-2.0.4 Trigger Example
I'm not sure if this is your issue as I have not used these triggers before but shouldn't the invertedindex table have a different primary key than the primary table (either f2 or f3)?
-Thunder

answered Jan 11 2014 at 14:50

Thunder Stumpges 's gravatar image


My guess is the trigger is trying to create a row with an empty key. 
Add some logging to the trigger to see what it�s doing. 
Cheers
Aaron Morton
New Zealand
@aaronmorton
Co-Founder & Principal Consultant
Apache Cassandra Consulting
http://www.thelastpickle.com

answered Jan 16 2014 at 19:55

Aaron Morton 's gravatar image


Related discussions

Tagged

Group Cassandra-user

asked Jan 11 2014 at 12:03

active Jan 16 2014 at 19:55

posts:3

users:3

©2013 QnaList.com