cassandra-cli

Only date range scanning Cassandra CQL timestamp

我与影子孤独终老i 提交于 2019-12-08 07:38:52
问题 I have a table like given below. CREATE TEST( HOURLYTIME TIMESTAMP, FULLTIME TIMESTAMP, DATA TEXT, PRIMARY KEY(HOURLYTIME,FULLTIME) ) I inserted the record (2014-12-12 00:00:00,2014-12-12 00:00:01,'Hello World') I would like to search based on date time range in HOURLYTIME field which holds hourly records.When i tried with token() like select * from TEST where token(HOURLYTIME)=token('2014-12-12') to get all the records for that date it returns only for one hour record i.e for 2014-12-12 **00

DROP COLUMN FAMILY from cassandra CLI will not drop the CF

泄露秘密 提交于 2019-12-07 11:57:02
问题 We tried to drop CF's using cassandra cli DROP COLUMN FAMILY cfName And when we list the CF from CLI it was not there and when i tried to get the existing CF's via hector I still could see the CF name KeyspaceDefinition keyspaceDefinition = newConnection().describeKeyspace(keyspaceName); keyspaceDefinition.getCfDefs(); Data inside the CF is not there however, the CF is still listed, after listing the CFs via hector if i do a cassandra -cli list column families i can see my deleted CF again

DROP COLUMN FAMILY from cassandra CLI will not drop the CF

爷,独闯天下 提交于 2019-12-05 21:52:36
We tried to drop CF's using cassandra cli DROP COLUMN FAMILY cfName And when we list the CF from CLI it was not there and when i tried to get the existing CF's via hector I still could see the CF name KeyspaceDefinition keyspaceDefinition = newConnection().describeKeyspace(keyspaceName); keyspaceDefinition.getCfDefs(); Data inside the CF is not there however, the CF is still listed, after listing the CFs via hector if i do a cassandra -cli list column families i can see my deleted CF again I had to deal with this issue back on Cassandra 1.1 as well. Basically, my column family had become

Cassandra cli: Convert hex values into a human-readable format

不问归期 提交于 2019-12-03 09:41:09
问题 Im starting with cassandra, and when I run list or get commands in cassandra-cli, I get results like this: [default@usersdatabase] list users; Using default limit of 100 ------------------- RowKey: boby => (column=6e616d65, value=426f62, timestamp=1294780856414000) ------------------- RowKey: edzuksm => (column=656d61696c, value=6d617268656c697340696e626f782e6c76, timestamp=1294780533705000) => (column=6e616d65, value=45647561726473, timestamp=1294780488155000) => (column=7375726e616d65,

What's the difference between creating a table and creating a columnfamily in Cassandra?

血红的双手。 提交于 2019-12-03 08:21:45
问题 I need details from both performance and query aspects, I learnt from some site that only a key can be given when using a columnfamily, if so what would you suggest for my keyspace, I need to use group by, order by, count, sum, ifnull, concat, joins, and some times nested queries. 回答1: To answer the original question you posed: a column family and a table are the same thing. The name "column family" was used in the older Thrift API. The name "table" is used in the newer CQL API. More info on

How to list all the available keyspaces in Cassandra?

瘦欲@ 提交于 2019-12-03 02:52:19
问题 I am newbie in Cassandra and trying to implement one toy application using Cassandra. I had created one keyspace and few column families in my Cassandra DB but I forgot the name of my cluster. I am trying to find if there is any query which can list down all the available keyspaces. Anybody knows such a query or command? 回答1: If you want to do this outside of the cqlsh tool you can query the schema_keyspaces table in the system keyspace. There's also a table called schema_columnfamilies which

Cassandra cli: Convert hex values into a human-readable format

谁说我不能喝 提交于 2019-12-03 00:03:30
Im starting with cassandra , and when I run list or get commands in cassandra-cli , I get results like this: [default@usersdatabase] list users; Using default limit of 100 ------------------- RowKey: boby => (column=6e616d65, value=426f62, timestamp=1294780856414000) ------------------- RowKey: edzuksm => (column=656d61696c, value=6d617268656c697340696e626f782e6c76, timestamp=1294780533705000) => (column=6e616d65, value=45647561726473, timestamp=1294780488155000) => (column=7375726e616d65, value=4d617268656c6973, timestamp=1294780515429000) 2 Rows Returned. I can't read it, I see only values

What's the difference between creating a table and creating a columnfamily in Cassandra?

陌路散爱 提交于 2019-12-02 22:03:41
I need details from both performance and query aspects, I learnt from some site that only a key can be given when using a columnfamily, if so what would you suggest for my keyspace, I need to use group by, order by, count, sum, ifnull, concat, joins, and some times nested queries. To answer the original question you posed: a column family and a table are the same thing. The name "column family" was used in the older Thrift API . The name "table" is used in the newer CQL API . More info on the APIs can be found here: http://wiki.apache.org/cassandra/API If you need to use "group by,order by

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

How to list all the available keyspaces in Cassandra?

吃可爱长大的小学妹 提交于 2019-12-02 16:26:47
I am newbie in Cassandra and trying to implement one toy application using Cassandra. I had created one keyspace and few column families in my Cassandra DB but I forgot the name of my cluster. I am trying to find if there is any query which can list down all the available keyspaces. Anybody knows such a query or command? If you want to do this outside of the cqlsh tool you can query the schema_keyspaces table in the system keyspace. There's also a table called schema_columnfamilies which contains information about all tables. The DESCRIBE and SHOW commands only work in cqlsh and cassandra-cli