cqlsh

Cassandra: Delete Works on Local But Not On Deployed

久未见 提交于 2019-12-24 23:18:17
问题 Our service is able to run SELECT and INSERT queries without any issues on our local and deployed Cassandra instances. However, we are having trouble with the following DELETE query: DELETE FROM config_by_uuid WHERE uuid = record_uuid; Our service is able to successfully delete a record on our local instance, but not on our deployed instance. Note that this behavior is constant for both instances, and that that no errors are being reported on our deployed instance. Notably, when the above

Cassandra CREATE CUSTOM INDEX ERROR java.lang.ClassNotFoundException

僤鯓⒐⒋嵵緔 提交于 2019-12-24 09:15:51
问题 -> Table : cassandra@cqlsh:coba> CREATE TABLE data( ... nim int, ... nama text, ... alamat text, ... PRIMARY KEY (nim, alamat) ... ); -> Make Index : CREATE CUSTOM INDEX cari_alamat ON coba.data (alamat) USING 'org.apache.cassandra.index.sasi.SASIIndex'; -> Error : ServerError: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.cassandra.index.sasi.SASIIndex -> I would be very happy if you can help me -> Thanks You 回答1: As initially susspected, I think you are running

run a bulk update query in cassandra on 1 column

天大地大妈咪最大 提交于 2019-12-24 08:16:08
问题 we have a scenario where a table in cassandra which has over million records and we want execute a bulk update on a column(basically set the column value to null in entire table). is there a way to do so since below query won't work in CQL UPDATE TABLE_NAME SET COL1=NULL WHERE PRIMARY_KEY IN(SELECT PRIMARY_KEY FROM TABLE_NAME ); P.S - the column is not a primary key or a cluster key. 回答1: There has been a similar question the other days regarding Deleting a column in cassandra for a large

Error during inserting data: NoHostAvailable:

本秂侑毒 提交于 2019-12-23 20:29:35
问题 I try to learn basics of Apache Cassandra. I found this simple example of application at https://docs.datastax.com/en/cql/3.1/cql/ddl/ddl_music_service_c.html So I created a keyspace, then I created a table, and now I am trying to add some data to the database. But when I try to Insert data I have got an error: "NoHostAvailable:" That's it. No more information. So far I've tried to update python driver (NoHostAvailable exception connecting to Cassandra from python) but it didn't work. What I

Unable to start cqlsh in Mac OS X?

情到浓时终转凉″ 提交于 2019-12-23 09:28:11
问题 I have installed cassandra 2.0 successfully. When I try to start cql 3 I get no such option: cassandra -v 2.0.9 ./cqlsh -3 Usage: cqlsh [options] [host [port]] cqlsh: error: no such option: -3 回答1: Once cassandra is starded (I guess in localhost with default settings) you can connect using ./cqlsh localhost if you want start it with a specific (older) version you can do ./cqlsh --cqlversion=X.Y.Z localhost; where X.Y.Z is the version (eg: 3.1.0) 来源: https://stackoverflow.com/questions

Is it possible to use variables in cql commands in cql scripts?

£可爱£侵袭症+ 提交于 2019-12-23 09:27:21
问题 Is there a way to pass variables in CQL commands when being used in CQL scripts like: select * from "Column Family Name" where "ColumnName"='A variable which takes different values'; Any suggestions are welcome. 回答1: No, CQL really doesn't have a way to define variables, run a loop, and update/query based on those variables. As an alternative, I typically use the DataStax Python driver for simple tasks/scripts like this. Here is an excerpt from a Python script I used a while back to populate

Getting “unable to complete request: one or more nodes were unavailable” when performing insert statement using cqlsh

≡放荡痞女 提交于 2019-12-21 17:41:35
问题 I'm trying to perform an insert on a brand new install of Cassandra 2, and while I was able to set up a new keyspace and table just fine, I get the eror mentioned above when attempting to perform an insert. I dont' have any fancy multi server setup, it's just running one one computer with a test db hence my confusion with node configuration Commands used to create said items are: CREATE KEYSPACE demodb WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'DC1' : 3 }; USE demodb; CREATE

Cassandra CQLSH TEXT field limit on COPY FROM CSV (field larger than field limit (131072))

 ̄綄美尐妖づ 提交于 2019-12-21 07:26:27
问题 When importing a record with a large field inside (longer than 124214 characters) I am getting the error "field larger than field limit (131072)" I saw form other posts how to solve this on Python but I don't know if it is possible on CQLSH. Thanks 回答1: Take a look at this answer: _csv.Error: field larger than field limit (131072) You will need to add this solution to the top of the cqlsh file. So after: import csv import getpass csv.field_size_limit(sys.maxsize) 回答2: Rather than hacking into

How to select data from a table and insert into another table?

限于喜欢 提交于 2019-12-20 09:37:26
问题 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? 回答1: 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

Cassandra - Delete not working

感情迁移 提交于 2019-12-19 02:31:07
问题 Sometimes; when I perform a DELETE; it doesn't work. My config : [cqlsh 5.0.1 | Cassandra 3.0.3 | CQL spec 3.4.0 | Native protocol v4] cqlsh:my_db> SELECT * FROM conversations WHERE user_id=120 AND conversation_id=2 AND peer_type=1; user_id | conversation_id | peer_type | message_map ---------+-----------------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------