cqlsh

“Bad Request: PRIMARY KEY part to_id cannot be restricted” when trying to select using where condition

三世轮回 提交于 2019-12-03 20:39:50
Here is my cassandra table for chat kind of application: CREATE TABLE tax_keyspace_dev.chat_messages ( message text, when timestamp, from_id text, to_id text, read boolean, participants text, PRIMARY KEY(participants, when, to_id) ); This query work: select * from tax_keyspace_dev.chat_messages where participants='caone@one.com_shashank_shrivastava@acme.com' order by when; but following queries don't work: select * from tax_keyspace_dev.chat_messages where to_id='caone@one.com' order by when; Error is " Bad Request: PRIMARY KEY part to_id cannot be restricted (preceding part when is either not

cassandra cql shell window got disappears after installation in windows

泪湿孤枕 提交于 2019-12-03 17:41:38
问题 cassandra cql shell window got disappears after installation in windows? this was installed using MSI installer availalbe in planet cassandra. Why this happens ? please help me.. Thanks in advance. 回答1: I had the same issue with DataStax 3.9. This is how I sorted this: Step 1: Open file: DataStax-DDC\apache-cassandra\conf\cassandra.yaml Step 2: Uncomment the cdc_raw_directory and set new value to (for windows) cdc_raw_directory: "C:/Program Files/DataStax-DDC/data/cdc_raw" Step 3: Goto

Cassandra data model for simple messaging app

。_饼干妹妹 提交于 2019-12-03 11:38:10
问题 I am trying to learn Cassandra and always find the best way is to start with creating a very simple and small application. Hence I am creating a basic messaging application which will use Cassandra as the back-end. I would like to do the following: User will create an account with a username, email, and password. The email and the password can be changed at anytime. The user can add another user as their contact. The user would add a contact by searching their username or email. The contacts

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 *

cassandra cql shell window got disappears after installation in windows

北城余情 提交于 2019-12-03 05:49:06
cassandra cql shell window got disappears after installation in windows? this was installed using MSI installer availalbe in planet cassandra. Why this happens ? please help me.. Thanks in advance. I had the same issue with DataStax 3.9. This is how I sorted this: Step 1: Open file: DataStax-DDC\apache-cassandra\conf\cassandra.yaml Step 2: Uncomment the cdc_raw_directory and set new value to (for windows) cdc_raw_directory: "C:/Program Files/DataStax-DDC/data/cdc_raw" Step 3: Goto Windows Services and Start the DataStax DDC Server 3.9.0 Service I had the same problem with DataStax Community 3

Cassandra data model for simple messaging app

蹲街弑〆低调 提交于 2019-12-03 03:00:51
I am trying to learn Cassandra and always find the best way is to start with creating a very simple and small application. Hence I am creating a basic messaging application which will use Cassandra as the back-end. I would like to do the following: User will create an account with a username, email, and password. The email and the password can be changed at anytime. The user can add another user as their contact. The user would add a contact by searching their username or email. The contacts don't need to be mutual meaning if I add a user they are my contact, I don't need to wait for them 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 select data from a table and insert into another table?

匆匆过客 提交于 2019-12-02 19:14:38
I want to select specific fields of a table in cassandra and insert them into another table. I do this in sql server like this: INSERT INTO Users(name,family) SELECT name,family FROM Users How to to this in cassandra-cli or cqlsh? COPY keyspace.columnfamily1 (column1, column2,...) TO 'temp.csv'; COPY keyspace.columnfamily2 (column1, column2,...) FROM 'temp.csv'; here give your keyspace(schema-name) and instead of columnfamilyname1 use the table to which you want to copy and in columnfamily2 give the tablename in which you want to copy.. And yes this is solution for CQL,however I have never

Cassandra `COPY FROM`unable to coerce GMT date string to a formatted date (long)

自闭症网瘾萝莉.ら 提交于 2019-12-02 01:25:25
问题 I have been trying to use COPY FROM to insert into a Cassandra table that has a timestamp type column. However, I encountered the following error: code=2200 [Invalid query] message="unable to coerce '2015-03-06 18:11:33GMT' to a formatted date (long)" Aborting import at record #3. Previously-inserted values still present. 0 rows imported in 0.211 seconds. The content of the CSV file was actually created with a COPY TO command. My TZ environment variable has been set to GMT . I did some

unable to coerce '2012/11/11' to a formatted date (long)

五迷三道 提交于 2019-12-01 23:18:31
问题 I am new to Cassandra cql (cqlsh 4.1.1, Cassandra 2.0.8.39, CQL spec 3.1.1, Thrift protocol 19.39.0) - using the cql COPY command to a table from a CSV formatted file and I get the following error: Bad Request: unable to coerce '2012/11/11' to a formatted date (long) . How do I change a column using cql so that it accepts the date from my CSV file? 回答1: as Brian said, there are CQL timestamp type to follow to get CQL query running. Sometimes it looks like quite weird indeed ! I've got the