Does an UPDATE become an implied INSERT

Yes, for Cassandra UPDATE is synonymous with INSERT, as explained in the CQL documentation where it says the following about UPDATE: Note that unlike in SQL, UPDATE does not check the prior existence of the row: the row is created if none existed before, and updated otherwise. Furthermore, there is no mean to know which … Read more

How to create auto increment IDs in Cassandra

How about the following, using Cassandra’s Lightweight transactions 1 – Create IDs table: CREATE TABLE ids ( id_name varchar, next_id int, PRIMARY KEY (id_name) ) 2 – Insert every id you’d like to use a global sequence with For example: INSERT INTO ids (id_name, next_id) VALUES (‘person_id’, 1) 3 – Then, when inserting to a … Read more

Cassandra server throws java.lang.AssertionError: DecoratedKey(…) != DecoratedKey

This is either https://issues.apache.org/jira/browse/CASSANDRA-4687 or https://issues.apache.org/jira/browse/CASSANDRA-5202 You can run the command “nodetool invalidatekeycache” on all of the server showing the error. If it keeps coming back you may want to disable key cache. If it is 5202 it should only happen after dropping and recreating a column family using the same name.

Cassandra UUID vs TimeUUID benefits and disadvantages

UUID and TIMEUUID are stored the same way in Cassandra, and they only really represent two different sorting implementations. TIMEUUID columns are sorted by their time components first, and then by their raw bytes, whereas UUID columns are sorted by their version first, then if both are version 1 by their time component, and finally … Read more

Cassandra cqlsh – connection refused

You need to edit cassandra.yaml on the node you are trying to connect to and set the node ip address for rpc_address and listen_address and restart Cassandra. rpc_address is the address on which Cassandra listens to the client calls. listen_address is the address on which Cassandra listens to the other Cassandra nodes.

How to get current timestamp with CQL while using Command Line?

You can use the timeuuid functions now() and dateof() (or in later versions of Cassandra, toTimestamp()), e.g., INSERT INTO TEST (ID, NAME, VALUE, LAST_MODIFIED_DATE) VALUES (‘2’, ‘elephant’, ‘SOME_VALUE’, dateof(now())); The now function takes no arguments and generates a new unique timeuuid (at the time where the statement using it is executed). The dateOf function takes … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)