cql

Cassandra multiprocessing can't pickle _thread.lock objects

半城伤御伤魂 提交于 2019-12-13 02:26:18
问题 I tried to use Cassandra and multiprocessing to insert rows (dummy data) concurrently based on the examples in http://www.datastax.com/dev/blog/datastax-python-driver-multiprocessing-example-for-improved-bulk-data-throughput This is my code class QueryManager(object): concurrency = 100 # chosen to match the default in execute_concurrent_with_args def __init__(self, session, process_count=None): self.pool = Pool(processes=process_count, initializer=self._setup, initargs=(session,))

Cassandra partial partition key

ⅰ亾dé卋堺 提交于 2019-12-13 02:22:51
问题 CREATE TABLE footable ( column1 text, column2 text, column3 text, column4 text, PRIMARY KEY ((column1, column2)) ) In the example above which I got from Querying Cassandra by a partial partition key, is it possible to use condition on the 1st partition key and select all condition on 2nd partition key? Example cql statement may look like this: select * from footable where column1 = 'name' and column2 ALL; Is there some sort of querying like this in Cassandra? 回答1: is it possible to use

Order by is currently only supported on the clustered columns of the PRIMARY KEY

北慕城南 提交于 2019-12-13 01:24:02
问题 cassandra2.0.7 cql 3.1.1 CREATE TABLE playlists ( id uuid, song_order int, song_id uuid, title text, album text, artist text, PRIMARY KEY (id, song_order ) ); INSERT INTO playlists (id, song_order, song_id, title, artist, album) VALUES (62c36092-82a1-3a00-93d1-46196ee77204, 1, a3e64f8f-bd44-4f28-b8d9-6938726e34d4, 'La Grange', 'ZZ Top', 'Tres Hombres'); INSERT INTO playlists (id, song_order, song_id, title, artist, album) VALUES (62c36092-82a1-3a00-93d1-46196ee77204, 2, 8a172618-b121-4136

Cassandra: change type from UUID to TIMEUUID

岁酱吖の 提交于 2019-12-13 01:05:58
问题 I'm trying to change the type of a column from UUID to TIMEUUID, but I'm unable to do so. ALTER TABLE Person ALTER KEY TYPE timeuuid; Error: Bad Request: Cannot change key from type uuid to type timeuuid: types are incompatible. Any idea on how to achieve this without losing the data from the column family? 回答1: It is not allowed. This is because TimeUUIDs have a different sorting pattern than regular UUIDs so Cassandra does not allow this. If you don't care about Columns being sorted by time

Cassandra CQL v3.0 & Composite Types

若如初见. 提交于 2019-12-12 17:07:39
问题 I was going through the documentation of CQLv3.0 Should we specify composite keys across updates and selects like 'a:b:1' incase my comparator or key_validation is ascii , ascii , int ? There is no mention on <select expression> in select or way to specify composite columns and rows in update too <primary/composite key name> Expecting some help over it 回答1: CQL 3 takes care of managing the actual composite types and values for you. CQL 3 rows are not necessarily the same as the underlying

how to implement fixed number of (timeuuid) columns in cassandra (with CQL)?

…衆ロ難τιáo~ 提交于 2019-12-12 16:27:15
问题 Here is an example use case: You need to store last N (let's say 1000 as fixed bucket size) user actions with all details in timeuuid based columns. Normally, each users' actions are already in "UserAction" column family where user id as row key, and actions in timeuuid columns. You may also have "AllActions" column family which stores all actions with same timeuuid as column name and user id as column value. It's basically a relationship column family but unfortunately without any details of

Cassandra .Net driver and CQL driver (Aug 2012)

匆匆过客 提交于 2019-12-12 15:09:12
问题 Questions have been asked on SO about this, but they are over a year old, so I'm re-posting. I'm not asking which is the "best" driver as that is subjective. I'm looking for data concerning stability, compliance to the latest Cassandra features, documentation and ease-of-use, and speed. It seems Hector has little activity (2 years ago per Github). So it's between Cassandra-sharp, Fluentcassandra, Aquiles, and Cassandraemo. I noticed some do and some don't mention the Thrift API. What's the

Cassandra cqlsh not working with where clause on non-partition key

扶醉桌前 提交于 2019-12-12 14:09:10
问题 My table describe is : CREATE TABLE user ( id text, CustID int static, UpdateDate date, DateOfBirth date static, Gender text static, Address text static, City text static, State text static, Zip text static, Email text static, Phone text static, OverallAssets double, PRIMARY KEY (id,UpdateDate) ); select * from user is working fine. select * from user where partition key is also working fine. But if I am putting non partition key in where clause getting below error.What can be the reason ?

CQL with a wide row - how to get most recent set?

安稳与你 提交于 2019-12-12 10:54:19
问题 How would I write the CQL to get the most recent set of data from each row? I'm investigating transitioning from MSSQL to Cassandra and am starting to grasp the concepts. Lots of research has help tremendously, but I haven't found answer to this (I know there must be a way): CREATE TABLE WideData { ID text, Updated timestamp, Title text, ReportData text, PRIMARY KEY (ID, Updated) } WITH CLUSTERING ORDER (Updated DESC) INSERT INTO WideData (ID, Updated, Title, ReportData) VALUES ('aaa', NOW,

Change the type of a column in Cassandra

跟風遠走 提交于 2019-12-12 10:06:15
问题 I have created a table my_table with a column phone , which has been declared as of type varint. After entering some data, I realized that it would have been better if I had declared this column as list<int>. I tried to: ALTER TABLE my_table ALTER phone TYPE list<int> but unfortunately I am not allowed to do so. Hopefully, there is a way to make this change. UPDATE: Assume that I make a new column phonelist of type list<int> . Is there any efficient way to move the data in the phone column