cql3

Error: unable to connect to cassandra server. Unconfigured table

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 03:26:07
问题 I am trying to connect to cassandra, which is running on local desktop, via cassandra-driver for python using this simple code. from cassandra.cluster import Cluster cluster = Cluster() session = cluster.connect() and getting this error: NoHostAvailable: ('Unable to connect to any servers', {'127.0.0.1': InvalidRequest(u'code=2200 [Invalid query] message="unconfigured table schema_keyspaces"',)}) From the logs of cassandra, I see how it does establish connection, but it gets this errors:

High number of tombstones with TTL columns in Cassandra

眉间皱痕 提交于 2019-12-22 01:29:17
问题 I have a cassandra Column Family, or CQL table with the following schema: CREATE TABLE user_actions ( company_id varchar, employee_id varchar, inserted_at timeuuid, action_type varchar, PRIMARY KEY ((company_id, employee_id), inserted_at) ) WITH CLUSTERING ORDER BY (inserted_at DESC); Basically a composite partition key that is made up of a company ID and an employee ID, and a clustering column, representing the insertion time, that is used to order the columns in reverse chronological order

Using Cassandra and CQL3, how do you insert an entire wide row in a single request?

这一生的挚爱 提交于 2019-12-21 04:54:29
问题 I want to insert a single row with 50,000 columns into Cassandra 1.2.8. Before inserting, I have all the data for the entire row ready to go (in memory): +---------+------+------+------+------+-------+ | | 0 | 1 | 2 | ... | 49999 | | row_id +------+------+------+------+-------+ | | text | text | text | ... | text | +---------+------+------+------|------+-------+ The column names are integers, allowing slicing for pagination. The column values are a value at that particular index. CQL3 table

Modeling many-to-many relations in Cassandra 2 with CQL3

橙三吉。 提交于 2019-12-21 02:42:08
问题 What is the canonical way to model many-to-many relations with CQL3 ? Let's say I have to tables CREATE TABLE actor ( id text PRIMARY KEY, given text, surname text, ) CREATE TABLE fan ( id text PRIMARY KEY, given text, surname text, ) and I'd like to model the fact that an actor can have many fan and each fan can like many actors. The first idea that came to my my was to use sets, like in the following (and the other way around for fans): CREATE TABLE actor ( id text PRIMARY KEY, given text,

cassandra add column if not exists

夙愿已清 提交于 2019-12-20 17:39:59
问题 I need to insert a new column into an existing column family via a CQL script. I want to do something like: alter COLUMNFAMILY rules ADD rule_template text IF NOT EXISTS; How can I achieve this purely in CQL script? 回答1: There is no optional "if not exists" for altering column families (tables). As a workaround you could just execute the alter command and ignore the error if the column already exists. There shouldn't be any harm in it, other than the error message. 来源: https://stackoverflow

Cassandra Error - Clustering column cannot be restricted (preceding column is restricted by a non-EQ relation)

心不动则不痛 提交于 2019-12-20 09:56:33
问题 We are using Cassandra as the data historian for our fleet management solution. We have a table in Cassandra , which stores the details of journey made by the vehicle. The table structure is as given below CREATE TABLE journeydetails( bucketid text, vehicleid text, starttime timestamp, stoptime timestamp, travelduration bigint, PRIMARY KEY (bucketid,vehicleid,starttime,travelduration) ); Where: bucketid :- partition key which is a combination of month and year vehicleid : -unique id of the

Cassandra - Overlapping Data Ranges

こ雲淡風輕ζ 提交于 2019-12-19 22:01:45
问题 I have the following 'Tasks' table in Cassandra. Task_ID UUID - Partition Key Starts_On TIMESTAMP - Clustering Column Ends_On TIMESTAMP - Clustering Column I want to run a CQL query to get the overlapping tasks for a given date range. For example, if I pass in two timestamps (T1 and T2) as parameters to the query, I want to get the all tasks that are applicable with in that range (that is, overlapping records). What is the best way to do this in Cassandra? I cannot just use two ranges on

how to perform “not in” filter in cql3 query select?

偶尔善良 提交于 2019-12-19 05:54:48
问题 I need to fetch rows without specific keys. for sample: select * from users where user_id not in ("mikko"); I have tried with "not in" and this is the response: Bad Request: line 1:35 no viable alternative at input 'not' 回答1: "not in" is not a supported operation in CQL. Cassandra at its heart is still based on key indexed rows. So that query is basically the same as "select * from users", as you have to go through every row and figure out if it does not match the in. If you want to do that

Creating column family or table in Cassandra while working Datastax API(which uses new Binary protocol)

孤街醉人 提交于 2019-12-19 03:38:11
问题 I have started working with Cassandra database. I am planning to use Datastax API to upsert/read into/from cassandra database. I am totally new to this Datastax API (which uses new Binary protocol) and I am not able to find lot of documentations as well which have some proper examples. When I was working with Cassandra CLI using the Netflix client(Astyanax client), then I created the column family like this- create column family profile with key_validation_class = 'UTF8Type' and comparator =

Cassandra selective copy

我们两清 提交于 2019-12-18 19:39:37
问题 I want to copy selected rows from a columnfamily to a .csv file. The copy command is available just to dump a column or entire table to a file without where clause. Is there a way to use where clause in copy command? Another way I thought of was, Do "Insert into table2 () values ( select * from table1 where <where_clause> );" and then dump the table2 to .csv , which is also not possible. Any help would be much appreciated. 回答1: There are no way to make a where clause in copy, but you can use