cql

RPC timeout in cqlsh - Cassandra

微笑、不失礼 提交于 2019-12-29 06:45:52
问题 I have 5 nodes in my ring with SimpleTopologyStrategy and replication_factor=3 . I inserted 1M rows using stress tool . When am trying to read the row count in cqlsh using SELECT count(*) FROM Keyspace1.Standard1 limit 1000000; It fails with error: Request did not complete within rpc_timeout. It fetches for limit 100000. Fails even for 500000. All my nodes are up. Do I need to increase the rpc_timeout ? Please help. 回答1: You get this error because the request is timing out on the server side.

Cassandra storage internal

萝らか妹 提交于 2019-12-29 06:25:46
问题 I'm trying to understand what exactly happens internally in storage engine level when a row(columns) is inserted in a CQL style table. CREATE TABLE log_date ( userid bigint, time timeuuid, category text, subcategory text, itemid text, count int, price int, PRIMARY KEY ((userid), time) - #1 PRIMARY KEY ((userid), time, category, subcategory, itemid, count, price) - #2 ); Suppose that I have a table like above. In case of #1, a CQL row will generate 6(or 5?) columns in storage. In case of #2, a

How Can I Search for Records That Have A Null/Empty Field Using CQL?

六眼飞鱼酱① 提交于 2019-12-28 06:19:13
问题 How can I write a query to find all records in a table that have a null/empty field? I tried tried the query below, but it doesn't return anything. SELECT * FROM book WHERE author = 'null'; 回答1: null fields don't exist in Cassandra unless you add them yourself. You might be thinking of the CQL data model, which hides certain implementation details in order to have a more understandable data model. Cassandra is sparse, which means that only data that is used is actually stored. You can

Using Cassandra for time-series data storage

假如想象 提交于 2019-12-25 18:23:24
问题 I'm a newbie to Cassandra and now evaluate it for our needs here - I need to handle a dynamic storage which holds a signal data from many sources. Each source provides, together with it's meta-data values, a continuous stream of signal data (time-value series). What is the best data-model, even just as a starting-point, to handle this kind of data? Is it possible to insert the data as a vector (and not sample by sample) using CQL? Any link with concrete examples will be highly appreciated!

How can we set nodetool and cqlsh to be run from anywhere and by any user on linux server

无人久伴 提交于 2019-12-25 07:58:26
问题 I am trying to setup environment variables so that any user on a particular server can run commands like nodetool or cqlsh from any where in linux file system . The effort to traverse to bin directory everytime should be saved . How can we achieve this ? My DSE 4.8 is a tarball install . 回答1: Nodetool is usually available to any user that has execution privileges in your linux boxes For cqlsh, you can set any configuration inside the cqlshrc file (usually found in $HOME/.cassandra/cqlshrc; we

Cassandra pagination inside partition

谁说胖子不能爱 提交于 2019-12-25 02:45:06
问题 How can I paginate data inside partition? I can`t use token for this, so I made microtime field with creation time and ordered records by it. Now I am slicing data using '<' and '>' and it makes a lot of constraints for my queries. Is there better way to do this? 回答1: For forward pagination, most of drivers (I definitely know about Java & Node.js) have notion of paging. You're basically execute your query, but set fetch size to value of number of entries that you want to have on page. You can

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

Do the concepts of wide rows, partitions, clustering columns/keys, and partition keys exist at Cassandra's querying language level?

廉价感情. 提交于 2019-12-24 18:23:09
问题 In Cassandra, do the concepts of wide rows, partitions, clustering columns/keys, and partition keys exist at the querying language level? Or are they internal implementation issues that users of the querying language are not aware of? Here is an example from How to understand the concept of wide row and related concepts in Cassandra?. In the commands in the query language, the above concepts seem not exist, but under the hook, they do. Consider a table created with a as partition key and b as

com.datastax.driver.core.exceptions.InvalidQueryException using Datastax Java driver

本小妞迷上赌 提交于 2019-12-24 12:39:50
问题 I created my column family like this from the CLI- create column family profile with key_validation_class = 'UTF8Type' and comparator = 'UTF8Type' and default_validation_class = 'UTF8Type' and column_metadata = [ {column_name : account, validation_class : 'UTF8Type'} {column_name : advertising, validation_class : 'UTF8Type'} {column_name : behavior, validation_class : 'UTF8Type'} {column_name : info, validation_class : 'UTF8Type'} ]; Now I was trying to insert into this column family using

CQL data type for storing an array of object

谁说胖子不能爱 提交于 2019-12-24 10:39:36
问题 I need to store an array of objects in a Cassandra DB column, for example, I may have a table that has a column named people, which would hold an array of objects: [ { name: one, age: 1 }, { name: two, age: 2 } ] However, looking at the docs, I can't find anything that would be a good data type for this except for people set<blob> but I'm wondering if there is something more explicit. 回答1: You can use user defined type (UDT) Create a UDT Type : CREATE TYPE people ( name text, age int ); Now