cql

cassandra primary key column cannot be restricted

笑着哭i 提交于 2019-12-03 11:19:16
问题 I am using Cassandra for the first time in a web app and I got a query problem. Here is my tab : CREATE TABLE vote ( doodle_id uuid, user_id uuid, schedule_id uuid, vote int, PRIMARY KEY ((doodle_id), user_id, schedule_id) ); On every request, I indicate my partition key, doodle_id. For example I can make without any problems : select * from vote where doodle_id = c4778a27-f2ca-4c96-8669-15dcbd5d34a7 and user_id = 97a7378a-e1bb-4586-ada1-177016405142; But on the last request I made : select *

how to load schema file into Cassandra with cqlsh

喜你入骨 提交于 2019-12-03 08:05:32
I have a schema file for Cassandra. I'm using a windows 7 machine (Cassandra on this machien as well - 1 node). I want to load the schema with cqssh. So far I have not been able to find how. I was hoping to be able to pass the file to cqlsh: cqlsh mySchemaFile . However since I run in windows, to start cqlsh I do the following python "C:\Program Files (x86)\DataStax Community\apache-cassandra\bin\cqlsh" localhost 9160 Even though I have csqsh in my path, when called like this from python it needs the full path. I tried to add in there the file name but no luck so far. Is this even possible?

Does CQL3 require a schema for Cassandra now?

筅森魡賤 提交于 2019-12-03 07:32:10
I've just had a crash course of Cassandra over the last week and went from Thrift API to CQL to grokking SuperColumns to learning I shouldn't use them and user Composite Keys instead. I'm now trying out CQL3 and it would appear that I can no longer insert into columns that are not defined in the schema, or see those columns in a select * Am I missing some option to enable this in CQL3 or does it expect me to define every column in the schema (defeating the purpose of wide, flexible rows, imho). Yes, CQL3 does require columns to be declared before used. But, you can do as many ALTERs as you

Insert to cassandra from python using cql

旧巷老猫 提交于 2019-12-03 05:43:22
I'm planning to insert data to bellow CF that has compound keys. CREATE TABLE event_attend ( event_id int, event_type varchar, event_user_id int, PRIMARY KEY (event_id, event_type) #compound keys... ); But I can't insert data to this CF from python using cql. (http://code.google.com/a/apache-extras.org/p/cassandra-dbapi2/) import cql connection = cql.connect(host, port, keyspace) cursor = connection.cursor() cursor.execute("INSERT INTO event_attend (event_id, event_type, event_user_id) VALUES (1, 'test', 2)", dict({}) ) I get the following traceback: Traceback (most recent call last): File ".

How does the Leveled Compaction Strategy ensure 90% of reads are from one sstable

谁都会走 提交于 2019-12-03 03:20:24
I am trying to understand how the Leveled Compaction Strategy in Cassandra works that guarantees 90% of all reads will be satisfied from a single sstable. From DataStax Doc: new sstables are added to the first level, L0, and immediately compacted with the sstables in L1. When L1 fills up, extra sstables are promoted to L2. Subsequent sstables generated in L1 will be compacted with the sstables in L2 with which they overlap. LeveledCompactionStrategy (LCS) in Cassandra implements the internals of LevelDB. You can check the exact implementation details in LevelDB implementation doc . In order to

cassandra primary key column cannot be restricted

帅比萌擦擦* 提交于 2019-12-03 02:45:19
I am using Cassandra for the first time in a web app and I got a query problem. Here is my tab : CREATE TABLE vote ( doodle_id uuid, user_id uuid, schedule_id uuid, vote int, PRIMARY KEY ((doodle_id), user_id, schedule_id) ); On every request, I indicate my partition key, doodle_id. For example I can make without any problems : select * from vote where doodle_id = c4778a27-f2ca-4c96-8669-15dcbd5d34a7 and user_id = 97a7378a-e1bb-4586-ada1-177016405142; But on the last request I made : select * from vote where doodle_id = c4778a27-f2ca-4c96-8669-15dcbd5d34a7 and schedule_id = c37df0ad-f61d-463e

How to retrieve only the information that got changed from Cassandra?

人盡茶涼 提交于 2019-12-02 16:40:12
问题 I am working on designing the Cassandra Column Family schema for my below use case.. I am not sure what is the best way to design the cassandra column family for my below use case? I will be using CQL Datastax Java driver for this.. Below is my use case and the sample schema that I have designed for now - SCHEMA_ID RECORD_NAME SCHEMA_VALUE TIMESTAMP 1 ABC some value t1 2 ABC some_other_value t2 3 DEF some value again t3 4 DEF some other value t4 5 GHI some new value t5 6 IOP some values again

com.impetus.kundera.query.QueryHandlerException: No entity found by the name: <EntityName>

萝らか妹 提交于 2019-12-02 16:19:07
问题 I am getting the following error when I run my application through SBT Console in Intellij IDEA 15, when the list page is opened which shows records from database: com.impetus.kundera.query.QueryHandlerException: No entity found by the name: Employee at com.impetus.kundera.query.KunderaQuery.initEntityClass(KunderaQuery.java:608) ~[kundera-core-3.2.jar:na] at com.impetus.kundera.query.KunderaQuery.postParsingInit(KunderaQuery.java:540) ~[kundera-core-3.2.jar:na] at com.impetus.kundera.query

Cassandra cql comparator type counter

删除回忆录丶 提交于 2019-12-02 15:10:17
问题 i want to use the following code for updating a field... @@db.execute("UPDATE user_count SET counters = counters + #{val} WHERE cid = 1 ") First time i tried that i got the following fail: CassandraCQL::Error::InvalidRequestException: invalid operation for non commutative columnfamily user_count I found out that i have to use the comparator counter, but i cant find how i can setup that with the cassandra-cql gem... does anybody know how i can get this to work? below there is my code that does

com.impetus.kundera.query.QueryHandlerException: No entity found by the name: <EntityName>

和自甴很熟 提交于 2019-12-02 11:18:28
I am getting the following error when I run my application through SBT Console in Intellij IDEA 15, when the list page is opened which shows records from database: com.impetus.kundera.query.QueryHandlerException: No entity found by the name: Employee at com.impetus.kundera.query.KunderaQuery.initEntityClass(KunderaQuery.java:608) ~[kundera-core-3.2.jar:na] at com.impetus.kundera.query.KunderaQuery.postParsingInit(KunderaQuery.java:540) ~[kundera-core-3.2.jar:na] at com.impetus.kundera.query.QueryResolver.getQueryImplementation(QueryResolver.java:86) ~[kundera-core-3.2.jar:na] at com.impetus