cql

Need to querying into a column (or collection) in Cassandra

僤鯓⒐⒋嵵緔 提交于 2020-01-06 20:19:45
问题 everyone :D I'm working with Cassandra (Datastax version) and I have an issue. I want to modeling a column who (always) gonna change. That's very hard, because I can't just create a column family with 1,2,3,4..10 columns. Because, tomorrow probably can change. I think in collections, but I got to query into these. I mean, I need query into this information every second. Ex: With map: <'col1':'val1','col2':'val2'> I need to query like this: SELECT * FROM example WHERE 'col1' = 'val1' AND 'col2

Select a specific record in Cassandra using cql

拜拜、爱过 提交于 2020-01-05 07:31:24
问题 This is the schema I use: CREATE TABLE playerInfo ( key text, column1 bigint, column2 bigint, column3 bigint, column4 bigint, column5 text, value bigint, PRIMARY KEY (key, column1, column2, column3, column4, column5) ) WITH COMPACT STORAGE AND bloom_filter_fp_chance=0.010000 AND caching='KEYS_ONLY' AND comment='' AND dclocal_read_repair_chance=0.000000 AND gc_grace_seconds=864000 AND read_repair_chance=0.100000 AND replicate_on_write='true' AND populate_io_cache_on_flush='false' AND

Can't export Cassandra table using Python

此生再无相见时 提交于 2020-01-04 08:15:10
问题 I am trying to export Cassandra table to CSV format using Python. But I couldn't do it. However, I am able to execute 'select' statement from Python. I have used the following code: from cassandra.cluster import Cluster cluster = Cluster () session = cluster.connect('chandan') ### 'chandan' is the name of the keyspace ## name of the table is 'emp' session.execute(""" copy emp (id,name) to 'E:\HANA\emp.csv' with HEADER = true """ ) print "Exported to the CSV file" Please help me in this regard

How can I have null column value for a composite key column in CQL3

巧了我就是萌 提交于 2020-01-03 13:38:23
问题 This may sound silly as there are no null values in SQL's composite primary key. But just want to confirm if we can have the same in CQL3? So, we have a table like this to store wide rows: CREATE TABLE keyspace12.colFamily1 ( id text, colname text, colvalue blob, PRIMARY KEY (id,colname, colvalue) ) WITH COMPACT STORAGE And we have some cases where colname is null. Can I do that? If yes, then how? If NO, then what are the ways to store wide columns rows where we can have some null in first

Cassandra assynchronous execution in multiple processes blocking synchronous requests

為{幸葍}努か 提交于 2020-01-03 04:40:11
问题 I have an application that reads a series of XML files containing logs of vehicles passages in a road. The application then processes each record, transform a few of the informations to match the database columns and inserts it into a cassandra database (running a single node in a remote server [it's in an internal network so connection isn't really an issue]). After inserting data in the database, the process for each file then goes on to read this data and produce information for summary

nDepend querying direct indirect methods for all methods in an assembly

旧城冷巷雨未停 提交于 2020-01-02 17:33:46
问题 I am trying to retrieve all direct indirect method calls for all methods in an assembly using the CQL provided by nDepend. Issue is I am not able to iterate through all methods inside a assembly to get this info. The DepthOfIsUsedBy only allows a string type and not a collection of strings. Is there a way t get this info for all methods inside an assembly? 回答1: What about using the method DepthOfIsUsing() instead of DepthOfIsUsedBy() :o) from m in Assemblies.WithNameNotIn("nunit.uikit")

Cassandra data modeling for one-to-many lookup

梦想与她 提交于 2020-01-01 19:11:11
问题 Consider the problem of storing users and their contacts. There are about a 100 million users, each has a few hundred contacts and on an average contacts are 1kb in size. There may be some users with too many contacts (>5000) and there may be some contacts that are much (say 10x) bigger than the average of 1kb. Users actively add contacts and less often also delete them. Contacts are not pointers to other users but just a bundle of information. There are two kinds of queries - Given a user

Cassandra data modeling for one-to-many lookup

冷暖自知 提交于 2020-01-01 19:10:07
问题 Consider the problem of storing users and their contacts. There are about a 100 million users, each has a few hundred contacts and on an average contacts are 1kb in size. There may be some users with too many contacts (>5000) and there may be some contacts that are much (say 10x) bigger than the average of 1kb. Users actively add contacts and less often also delete them. Contacts are not pointers to other users but just a bundle of information. There are two kinds of queries - Given a user

how to load schema file into Cassandra with cqlsh

瘦欲@ 提交于 2020-01-01 03:23:07
问题 I have a schema file for Cassandra. I'm using a windows 7 machine (Cassandra on this machien as well - 1 node). I want to load the schema with cqssh. So far I have not been able to find how. I was hoping to be able to pass the file to cqlsh: cqlsh mySchemaFile . However since I run in windows, to start cqlsh I do the following python "C:\Program Files (x86)\DataStax Community\apache-cassandra\bin\cqlsh" localhost 9160 Even though I have csqsh in my path, when called like this from python it

How to retrieve the timestamp from cassandra?

左心房为你撑大大i 提交于 2019-12-30 05:59:49
问题 In the below cassandra, "get result"..we can able to retrieve the column name and values. But how to retrieve the timestamp..Is there any better idea to get the values by using timestamp [default@sample]get user[bob]; => (column=name, value=bobdroid, timestamp=1335361733545850) => (column=email, value=bob@gmail.com, timestamp=1335361733545850) => (column=age, value=23, timestamp=1335361733545850) => (column=password, value=MTIz, timestamp=1335361733545850) Returned 4 results. Elapsed time: 4