Re: CQL data type compatibility between ascii and text

2018-08-10 Thread thiranjith
Thanks Yoshi! That explains it a lot :) On Fri, 10 Aug 2018 18:30:25 +1000  Y K wrote Hi Thira, First, there's the 3.0 branch of versions and the 3.x branch of versions. http://cassandra.apache.org/doc/latest/development/patches.html#choosing-the-right-branches-to-work-on The 3.0.16 b

Re: CQL data type compatibility between ascii and text

2018-08-10 Thread Y K
Hi Thira, First, there's the 3.0 branch of versions and the 3.x branch of versions. http://cassandra.apache.org/doc/latest/development/patches.html#choosing-the-right-branches-to-work-on The 3.0.16 belongs to the 3.0 branch. The 3.9 and 3.11.2 belong to the 3.x. branch I believe the change was m

Re: CQL Map vs clustering keys

2017-11-16 Thread eugene miretsky
Thanks! So assuming C* 3.0 and that my table stores only one collection, using clustering keys will be more performant? Extending this to sets - would doing something like this make sense? ( id UUID PRIMARY KEY, val text, PRIMARY KEY (id, val)) ); SELECT count(*) FROM TABLE WHERE id = 123

Re: CQL Map vs clustering keys

2017-11-15 Thread Jon Haddad
In 3.0, clustering columns are not actually part of the column name anymore. Yay. Aaron Morton wrote a detailed analysis of the 3.x storage engine here: http://thelastpickle.com/blog/2016/03/04/introductiont-to-the-apache-cassandra-3-storage-engine.html

Re: CQL Map vs clustering keys

2017-11-15 Thread DuyHai Doan
Yes, your remark is correct. However, once CASSANDRA-7396 (right now in 4.0 trunk) get released, you will be able to get a slice of map values using their (sorted) keys SELECT map[fromKey ... toKey] FROM TABLE ... Needless to say, it will be also possible to get a single element from the map by

Re: CQL: fails to COPY FROM with null values

2017-06-19 Thread Stefania Alborghetti
It doesn't work because of the white space. By default the NULL value is an empty string, extra white spaces are not trimmed automatically. This should work: ce98d62a-3666-4d3a-ae2f-df315ad448aa,Jonsson,Malcom,,2001-01-19 17:55:17+ You can change the string representing missing values with t

Re: CQL datatype for long?

2016-12-23 Thread Varun Barala
yes!! On Thu, Dec 8, 2016 at 1:21 PM, Check Peck wrote: > And then from datastax java driver, I can use. Am I right? > > To Read: > row.getLong(); > > To write > boundStatement.setLong() > > > On Wed, Dec 7, 2016 at 6:50 PM, Varun Barala > wrote: > >> use `bigint` for long. >> >> >> Regards, >

Re: CQL datatype for long?

2016-12-07 Thread Check Peck
And then from datastax java driver, I can use. Am I right? To Read: row.getLong(); To write boundStatement.setLong() On Wed, Dec 7, 2016 at 6:50 PM, Varun Barala wrote: > use `bigint` for long. > > > Regards, > Varun Barala > > On Thu, Dec 8, 2016 at 10:32 AM, Check Peck > wrote: > >> What

Re: CQL datatype for long?

2016-12-07 Thread Varun Barala
use `bigint` for long. Regards, Varun Barala On Thu, Dec 8, 2016 at 10:32 AM, Check Peck wrote: > What is the CQL data type I should use for long? I have to create a column > with long data type. Cassandra version is 2.0.10. > > CREATE TABLE storage ( > key text, > clientid in

Re: cql-maven-plugin

2016-10-07 Thread Brice Dutheil
At this moment no, as this is a maven plugin. Extracting such code would be relatively trivial. -- Brice On Fri, Oct 7, 2016 at 1:24 PM, Ali Akhtar wrote: > Is there a way to call this programatically such as from unit tests, to > create keyspace / table schema from a cql file? > > On Fri, Oct

Re: cql-maven-plugin

2016-10-07 Thread Ali Akhtar
Is there a way to call this programatically such as from unit tests, to create keyspace / table schema from a cql file? On Fri, Oct 7, 2016 at 2:40 PM, Brice Dutheil wrote: > Hi there, > > I’d like to share a very simple project around handling CQL files with > maven. We were using the cassandra

Re: CQL Composite Key Seen After Table Creation

2016-01-15 Thread Chris Burroughs
On 01/06/2016 04:47 PM, Robert Coli wrote: On Wed, Jan 6, 2016 at 12:54 PM, Chris Burroughs wrote: The problem with that approach is that manually editing the local schema tables in live cluster is wildly dangerous. I *think* this would work: * Make triple sure no schema changes are happeni

Re: CQL Composite Key Seen After Table Creation

2016-01-06 Thread Robert Coli
On Wed, Jan 6, 2016 at 12:54 PM, Chris Burroughs wrote: > I work with Amir and further experimentation I can shed a little more > light on what exactly is going on under the hood. For background our goal > is to take data that is currently being read and written to via thrift, > switch reads to

Re: CQL Composite Key Seen After Table Creation

2016-01-06 Thread Chris Burroughs
I work with Amir and further experimentation I can shed a little more light on what exactly is going on under the hood. For background our goal is to take data that is currently being read and written to via thrift, switch reads to CQL, and then switch writes to CQL. This is in alternative to

Re: CQL Composite Key Seen After Table Creation

2015-12-28 Thread Robert Coli
On Tue, Dec 22, 2015 at 6:55 AM, Amir Hassani wrote: > Defining the “column_metadata” after table creation vs during table > creation seems to affect the cql schema. We are running a large > high-throughput Cassandra 2.1.10 cluster. During table creation, the client > Cassandra-cli was used with

Re: CQL error when adding multiple conditional update statements in the same batch

2015-10-08 Thread Peddi, Praveen
e.org<mailto:user@cassandra.apache.org>" mailto:user@cassandra.apache.org>> Date: Thursday, October 8, 2015 at 4:41 PM To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" mailto:user@cassandra.apache.org>> Subject: Re: CQL error when adding mult

Re: CQL error when adding multiple conditional update statements in the same batch

2015-10-08 Thread Peddi, Praveen
@cassandra.apache.org>" mailto:user@cassandra.apache.org>> Subject: Re: CQL error when adding multiple conditional update statements in the same batch I assume you're running Cassandra 2.0? In 2.1.1 the check for "incompatible" conditions was removed (see t

Re: CQL error when adding multiple conditional update statements in the same batch

2015-10-08 Thread Tyler Hobbs
I assume you're running Cassandra 2.0? In 2.1.1 the check for "incompatible" conditions was removed (see this comment for details)

Re: CQL error when adding multiple conditional update statements in the same batch

2015-10-08 Thread sai krishnam raju potturi
could you also provide the columnfamily schema. On Thu, Oct 8, 2015 at 4:13 PM, Peddi, Praveen wrote: > Hi, > > I am trying to understand this error message that CQL is throwing when I > try to update 2 different rows with different values on same conditional > columns. Doesn't CQL support that?

Re: CQL 3.x Update ...USING TIMESTAMP...

2015-09-12 Thread Sachin Nikam
@Tyler, Going back to your earlier proposal i.e. -- Instead, make the version part of the primary key: CREATE TABLE document_store (document_id bigint, version int, document text, PRIMARY KEY (document_id, version)) WITH CLUSTERING ORDER BY (version desc) --- My concern with this approach

Re: CQL collections and Solr dynamic fields

2015-06-22 Thread Sebastian Estevez
Jack thanks for your reply. I apologize for the confusion caused by my previous statement. I was thinking just of maps when I replied. Correction - *Lists and Sets are indexed as multivalued fields in DSE Search and Maps are stored as dynamic fields in DSE Search. * Both are indexed automaticall

Re: CQL collections and Solr dynamic fields

2015-06-22 Thread Jack Krupansky
Please do get that clarified - the doc currently says that lists and sets are implemented as multvalued fields, which contradicts your statement. Yes, map collections are implemented as dynamic fields, but list and set collections are somewhat different - or at least the doc says that they are: "*C

Re: CQL collections and Solr dynamic fields

2015-06-22 Thread Sebastian Estevez
Quick clarification, collections are implemented as dynamic fields in DSE (not multivalued fields). Fields that are both dynamic and multivalued are not supported, therefore, you cannot use multivalued fields for collections. All the best, [image: datastax_logo.png]

Re: CQL collections and Solr dynamic fields

2015-06-22 Thread Jack Krupansky
Well, the doc does state that limitation - "*In CQL-based Solr cores, the Solr schema fields that are dynamic and multivalued are not supported*" - but DataStax will have to clarify whether that is still true and true for lists and sets. See: http://docs.datastax.com/en/datastax_enterprise/4.7//da

Re: CQL collections and Solr dynamic fields

2015-06-22 Thread Moshe Kranc
Lists and sets are implemented as multivalue fields, and dse solr does not support dynamic multivalue fields. Therefore, I conclude that dse solr does not support dynamic field search for sets and lists, I. E. I will have to modify the solr schema and re-index each time I add a new CQL llist or set

Re: CQL collections and Solr dynamic fields

2015-06-22 Thread Jack Krupansky
List and set collections are mapped to multivalued Solr fields - a Solr query will match on any of the values in a multivalued Solr field (or keywords within those multiple values for Solr tokenized text fields.) See: http://docs.datastax.com/en/datastax_enterprise/4.7//datastax_enterprise/srch/sr

Re: CQL Data Model question

2015-05-14 Thread Alaa Zubaidi (PDF)
Thanks Ngoc, Jack On Tue, May 12, 2015 at 4:56 AM, Ngoc Minh VO wrote: > Hello, > > > > The problem with your approach is: you will need to specify all the 30 > filters (in the pre-defined order in PK) when querying. > > > > I would go for this data model: > > CREATE TABLE t ( > > name text

Re: CQL Data Model question

2015-05-12 Thread Jack Krupansky
Porting an SQL data model to Cassandra is an anti-pattern - don't do it! Instead, focus on developing a new data model that capitalizes on the key strengths of Cassandra - distributed, scalable, fast writes, fast direct access. Complex and ad-hoc queries are anti-patterns as well. I'll leave it to

RE: CQL Data Model question

2015-05-12 Thread Ngoc Minh VO
Hello, The problem with your approach is: you will need to specify all the 30 filters (in the pre-defined order in PK) when querying. I would go for this data model: CREATE TABLE t ( name text, filter_name1 text, filter_value1 text, filter_name2 text, filter_value2 text, filter_n

Re: CQL 3.x Update ...USING TIMESTAMP...

2015-04-21 Thread Tyler Hobbs
On Mon, Apr 20, 2015 at 4:02 PM, Sachin Nikam wrote: > #1. We have 2 data centers located close by with plans to expand to more > data centers which are even further away geographically. > #2. How will this impact light weight transactions when there is high > level of network contention for cros

Re: CQL 3.x Update ...USING TIMESTAMP...

2015-04-20 Thread Sachin Nikam
Tyler, I can consider trying out light weight transactions, but here are my concerns #1. We have 2 data centers located close by with plans to expand to more data centers which are even further away geographically. #2. How will this impact light weight transactions when there is high level of netwo

Re: CQL 3.x Update ...USING TIMESTAMP...

2015-03-24 Thread Tyler Hobbs
> > do you just mean that it's easy to forget to always set your timestamp > correctly, and if you goof it up, it makes it difficult to recover from > (i.e. you issue a delete with system timestamp instead of document version, > and that's way larger than your document version would ever be, so you

Re: CQL 3.x Update ...USING TIMESTAMP...

2015-03-22 Thread Sachin Nikam
@Eric Stevens Thanks for representing my position while I came back to this thread. @Tyler With your recommendation, won't I end up saving all the version(s) of the document. In my case the document is pretty huge (~5mb) and each document has up to 10 versions. And you already highlighted that lig

Re: CQL 3.x Update ...USING TIMESTAMP...

2015-03-13 Thread Brice Dutheil
I agree with Tyler, in the normal run of a live application I would not recommend the use of the timestamp, and use other ways to *version* *inserts*. Otherwise you may fall in the *upsert* pitfalls that Tyler mentions. However I find there’s a legitimate use the USING TIMESTAMP trick, when migrat

Re: CQL 3.x Update ...USING TIMESTAMP...

2015-03-12 Thread Eric Stevens
Ok, but if you're using a system of time that isn't server clock oriented (Sachin's document revision ID, and my fixed and necessarily consistent base timestamp [B's always know their parent A's exact recorded timestamp]), isn't the principle of using timestamps to force a particular update out of

Re: CQL 3.x Update ...USING TIMESTAMP...

2015-03-12 Thread Jonathan Haddad
In most datacenters you're going to see significant variance in your server times. Likely > 20ms between servers in the same rack. Even google, using atomic clocks, has 1-7ms variance. [1] I would +1 Tyler's advice here, as using the clocks is only valid if clocks are perfectly sync'ed, which t

Re: CQL 3.x Update ...USING TIMESTAMP...

2015-03-12 Thread Eric Stevens
> It's possible, but you'll end up with problems when attempting to overwrite or delete entries I'm wondering if you can elucidate on that a little bit, do you just mean that it's easy to forget to always set your timestamp correctly, and if you goof it up, it makes it difficult to recover from (i

Re: CQL 3.x Update ...USING TIMESTAMP...

2015-03-11 Thread Tyler Hobbs
Don't use the version as your timestamp. It's possible, but you'll end up with problems when attempting to overwrite or delete entries. Instead, make the version part of the primary key: CREATE TABLE document_store (document_id bigint, version int, document text, PRIMARY KEY (document_id, versio

Re: CQL "Alter table" does not propagate to all nodes.

2014-10-17 Thread Erick Ramirez
Lu, Thanks for the letting me know that you figured it out. Cheers, Erick

Re: CQL "Alter table" does not propagate to all nodes.

2014-10-16 Thread dlu66061
Thank you very much, Erick. Yes, we are using NTP. But your other suggestions and links are very helpful. I tried to grep MigrationStage from system.log and found "Can't send migration request: node /201.20.32.54 is down." around the time I ran the CQL, although that server is actually up running

Re: CQL "Alter table" does not propagate to all nodes.

2014-10-15 Thread Erick Ramirez
Hello, dlu66061. A common issue with schema disagreements is time drift on the nodes. Are you using NTP? The only other issue is when the nodes are not reachable at the time that the schema update was being propagated --- http://www.datastax.com/documentation/cassandra/2.0/cassandra/dml/dml_handl

Re: CQL query throws TombstoneOverwhelmingException against a LeveledCompactionStrategy table

2014-10-06 Thread dlu66061
BTW, I am using Cassandra 2.0.6. Is this the same as CASSANDRA-6654 (Droppable tombstones are not being removed from LCS table despite being above 20%) ? I checked my table in JConsole and the droppable tombstone ratio of over 60%. If it is

Re: CQL performance inserting multiple cluster keys under same partition key

2014-08-27 Thread Jaydeep Chovatia
This clarifies my doubt. Thanks You Sylvain for your help. On Tue, Aug 26, 2014 at 11:59 PM, Sylvain Lebresne wrote: > On Tue, Aug 26, 2014 at 6:50 PM, Jaydeep Chovatia < > chovatia.jayd...@gmail.com> wrote: > >> Hi, >> >> I have question on inserting multiple cluster keys under same partition

Re: CQL performance inserting multiple cluster keys under same partition key

2014-08-27 Thread Sylvain Lebresne
On Tue, Aug 26, 2014 at 6:50 PM, Jaydeep Chovatia < chovatia.jayd...@gmail.com> wrote: > Hi, > > I have question on inserting multiple cluster keys under same partition > key. > > Ex: > > CREATE TABLE Employee ( > deptId int, > empId int, > name varchar, > address varchar, > salary int

Re: CQL performance inserting multiple cluster keys under same partition key

2014-08-26 Thread Jaydeep Chovatia
But if we look at thrift world "batch_mutate" then it used to perform all mutations withing partition key atomically without using CAS i.e no extra penalty. Does this mean CQL degrades in performance as compared to thrift if we want to do multiple updates to a partition key atomically? On Tue, Au

Re: CQL performance inserting multiple cluster keys under same partition key

2014-08-26 Thread Vivek Mishra
AFAIK, it is not. With CAS it should br On 26/08/2014 10:21 pm, "Jaydeep Chovatia" wrote: > Hi, > > I have question on inserting multiple cluster keys under same partition > key. > > Ex: > > CREATE TABLE Employee ( > deptId int, > empId int, > name varchar, > address varchar, > salary

Re: CQL query regarding indexes

2014-06-13 Thread Akash Pandey
Use senttime as part of primary key CREATE TABLE services.messagepayload_by_date ( record_date timestamp partition_id uuid, messageid bigint, senttime timestamp, PRIMARY KEY (record_date, senttime ) ) Partition id itself should be chronological say a date. Then you put partition id in yo

Re: CQL query regarding indexes

2014-06-12 Thread Jabbar Azam
In this use case you don't need the secondary index. Instead use Primary key(partition_id, senttime) Thanks Jabbar Azam On 12 Jun 2014 23:44, "Roshan" wrote: > Hi > > Cassandra - 2.0.8 > DataStax driver - 2.0.2 > > I have create a keyspace and a table with indexes like below. > CREATE TABLE ser

Re: CQL query regarding indexes

2014-06-12 Thread Bulat Shakirzyanov
As far as I can tell, the problem is that you're not using a partition key in your query. AFAIK, you always have to use partition key in where clause. And ALLOW FILTERING option is to let cassandra filter data from the rows it found using the partition key. One way to solve it is to make partition

Re: CQL 3 and wide rows

2014-05-20 Thread Maciej Miklas
Thank you Nate - now I understand it ! This is real improvement when compared to CLI :) Regards, Maciej On 20 May 2014, at 17:16, Nate McCall wrote: > Something like this might work: > > > cqlsh:my_keyspace> CREATE TABLE my_widerow ( > ... id text, > ...

Re: CQL 3 and wide rows

2014-05-20 Thread Nate McCall
Something like this might work: cqlsh:my_keyspace> CREATE TABLE my_widerow ( ... id text, ... my_col timeuuid, ... PRIMARY KEY (id, my_col) ... ) WITH caching='KEYS_ONLY' AND ... compaction={'class': 'Lev

Re: CQL 3 and wide rows

2014-05-20 Thread Maciej Miklas
Hi Aron, Thanks for the answer! Lest consider such CLI code: for(int i = 0 ; i < 10_000_000 ; i++) { set[‘rowKey1’][‘myCol::i’] = UUID.randomUUID(); } The code above will create single row, that contains 10^6 columns sorted by ‘i’. This will work fine, and this is the wide row to my unders

Re: CQL 3 and wide rows

2014-05-20 Thread Maciej Miklas
imary key”. > > -- Jack Krupansky > > From: Aaron Morton > Sent: Tuesday, May 20, 2014 3:06 AM > To: Cassandra User > Subject: Re: CQL 3 and wide rows > > In a CQL 3 table the only **column** names are the ones defined in the table, > in the example below there are three

Re: CQL 3 and wide rows

2014-05-20 Thread Jack Krupansky
To: Cassandra User Subject: Re: CQL 3 and wide rows In a CQL 3 table the only **column** names are the ones defined in the table, in the example below there are three column names. CREATE TABLE keyspace.widerow ( row_key text, wide_row_column text, data_column text

Re: CQL 3 and wide rows

2014-05-20 Thread Aaron Morton
In a CQL 3 table the only **column** names are the ones defined in the table, in the example below there are three column names. >> CREATE TABLE keyspace.widerow ( >> row_key text, >> wide_row_column text, >> data_column text, >> PRIMARY KEY (row_key, wide_row_column)); >> >> Check out, for ex

Re: CQL 3 and wide rows

2014-05-19 Thread Maciej Miklas
Hi James, Clustering is based on rows. I think that you meant not clustering columns, but compound columns. Still all columns belong to single table and are stored within single folder on one computer. And it looks to me (but I’am not sure) that CQL 3 driver loads all column names into memory -

Re: CQL 3 and wide rows

2014-05-19 Thread Maciej Miklas
Hallo Jack, You have given a perfect example for wide row. Each reading from sensor creates new column within a row. It was also possible with Hector/CLI to have millions of columns within a single row. According to this page http://wiki.apache.org/cassandra/CassandraLimitations single row can

Re: CQL 3 and wide rows

2014-05-19 Thread Jack Krupansky
You might want to review this blog post on supporting dynamic columns in CQL3, which points out that “the way to model dynamic cells in CQL is with a compound primary key.” See: http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows -- Jack Krupansky From: Maciej Miklas S

RE: CQL 3 and wide rows

2014-05-19 Thread James Campbell
Maciej, In CQL3 "wide rows" are expected to be created using clustering columns. So while the schema will have a relatively smaller number of named columns, the effect is a wide row. For example: CREATE TABLE keyspace.widerow ( row_key text, wide_row_column text, data_column text, PRIMA

Re: CQL Select Map using an IN relationship

2014-03-14 Thread David Savage
Hi Michael, Thanks for the feedback, all makes sense. If anyone wants me to raise a jira ticket for docs on (key1, key2) vs ((key1,key2)) and their implications, or fixing that if block in SelectStatement, let me know - though for the if block possibly best if that jira is raised by a C* expert s

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Laing, Michael
These are my personal opinions, reflecting both my long experience w database systems, and my newness to Cassandra... [tl;dr] The Cassandra contributors, having made its history, tend to describe it in terms of implementation rather than action. And its implementation has a history, all relativel

Re: CQL Select Map using an IN relationship

2014-03-13 Thread David Savage
be in the same partition or > distributed. > > -- Jack Krupansky > > *From:* Laing, Michael > *Sent:* Thursday, March 13, 2014 1:39 PM > *To:* user@cassandra.apache.org > *Subject:* Re: CQL Select Map using an IN relationship > > Think of them as: > > >

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Laing, Michael
13, 2014 1:39 PM > *To:* user@cassandra.apache.org > *Subject:* Re: CQL Select Map using an IN relationship > > Think of them as: > > > PRIMARY KEY (partition_key[, range_key]) > > > where the partition_key can be compounded as: > > > (partition_key0 [, partit

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Jack Krupansky
. -- Jack Krupansky From: Laing, Michael Sent: Thursday, March 13, 2014 1:39 PM To: user@cassandra.apache.org Subject: Re: CQL Select Map using an IN relationship Think of them as: PRIMARY KEY (partition_key[, range_key]) where the partition_key can be compounded as: (partition_key0

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Laing, Michael
Think of them as: PRIMARY KEY (partition_key[, range_key]) where the partition_key can be compounded as: (partition_key0 [, partition_key1, ...]) and the optional range_key can be compounded as: range_key0 [, range_key1 ...] If you do this: PRIMARY KEY (key1, key2) - then key1 is the partitio

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Sylvain Lebresne
On Thu, Mar 13, 2014 at 12:12 PM, David Savage wrote: > Hi there, > > I'm experimenting using cassandra and have run across an error message > which I need a little more information on. > > The use case I'm experimenting with is a series of document updates > (documents being an arbitrary map of k

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Peter Lin
probably a good idea to open a jira ticket to explain this better in the docs. the downside of moving so fast is the docs often fall behind and users have to dig around to figure things out. not everyone wants to read the CQL3 antlr grammar to figure things out. On Thu, Mar 13, 2014 at 11:27 AM,

Re: CQL Select Map using an IN relationship

2014-03-13 Thread David Savage
Great that works, thx! I probably would have never found that... It now makes me wonder in general when to use PRIMARY KEY (key1, key2) or PRIMARY KEY ((key1, key2)), any examples would be welcome if you have the time. Kind regards, Dave On Thu, Mar 13, 2014 at 2:56 PM, Laing, Michael wrote:

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Laing, Michael
Create your table like this and it will work: CREATE TABLE test.documents (group text,id bigint,data map,PRIMARY KEY ((group, id))); The extra parens catenate 'group' and 'id' into the partition key - IN will work on the last component of a partition key. ml On Thu, Mar 13, 2014 at 10:40 AM, D

Re: CQL Select Map using an IN relationship

2014-03-13 Thread David Savage
Nope, upgraded to 2.0.5 and still get the same problem, I actually simplified the problem a little in my first post, there's a composite primary key involved as I need to partition ids into groups So the full CQL statements are: CREATE KEYSPACE test WITH replication = {'class':'SimpleStrategy', '

Re: CQL Select Map using an IN relationship

2014-03-13 Thread David Savage
Hmmm that maybe the problem, I'm currently testing with 2.0.2 which got dragged in by the cassandra unit library I'm using for testing [1] I will try to fix my build dependencies and retry, thx. /Dave [1] https://github.com/jsevellec/cassandra-unit On Thu, Mar 13, 2014 at 1:56 PM, Laing, Michae

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Laing, Michael
I have no problem doing this w 2.0.5 - what version of C* are you using? Or maybe I don't understand your data model... attach 'creates' if you don't mind. ml On Thu, Mar 13, 2014 at 9:24 AM, David Savage wrote: > Hi Peter, > > Thanks for the help, unfortunately I'm not sure that's the problem,

Re: CQL Select Map using an IN relationship

2014-03-13 Thread David Savage
Hi Peter, Thanks for the help, unfortunately I'm not sure that's the problem, the id is the primary key on the documents table and the timestamp is the primary key on the eventlog table Kind regards, Dave On Thursday, 13 March 2014, Peter Lin wrote: > > it's not clear to me if your "id" colu

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Peter Lin
it's not clear to me if your "id" column is the KEY or just a regular column with secondary index. queries that have IN on non primary key columns isn't supported yet. not sure if that answers your question. On Thu, Mar 13, 2014 at 7:12 AM, David Savage wrote: > Hi there, > > I'm experimenting

Re: CQL and reserved keywords

2014-03-04 Thread Michael Shuler
On 03/04/2014 03:56 AM, DuyHai Doan wrote: Hello Andy 1. "Is there a list somewhere of reserved keywords that I can access so that I prohibit a user entering such a column name?" -> http://www.datastax.com/documentation/cql/3.0/cql/cql_reference/keywords_r.html 2. you may propose a pull request

Re: CQL and reserved keywords

2014-03-04 Thread DuyHai Doan
Hello Andy 1. "Is there a list somewhere of reserved keywords that I can access so that I prohibit a user entering such a column name?" -> http://www.datastax.com/documentation/cql/3.0/cql/cql_reference/keywords_r.html 2. you may propose a pull request ? On Tue, Mar 4, 2014 at 10:52 AM, Andy

Re: CQL: Any way to have inequalities on multiple clustering columns in a WHERE clause?

2014-02-28 Thread Clint Kelly
Yes, thank you! On Thu, Feb 27, 2014 at 10:26 PM, DuyHai Doan wrote: > Clint, what you want is this : > https://issues.apache.org/jira/browse/CASSANDRA-4851 > > select * from foo where key=something and fam = 'Info' and (qual,version) > > ('A',2013) and qual < 'D' ALLOW FILTERING >

Re: CQL: Any way to have inequalities on multiple clustering columns in a WHERE clause?

2014-02-27 Thread DuyHai Doan
Clint, what you want is this : https://issues.apache.org/jira/browse/CASSANDRA-4851 select * from foo where key=something and fam = 'Info' and (qual,version) > ('A',2013) and qual < 'D' ALLOW FILTERING On Fri, Feb 28, 2014 at 6:57 AM, Clint Kelly wrote: > All, > > Is there any way to have ineq

Re: CQL decimal encoding

2014-02-26 Thread Ben Hood
On Thu, Feb 27, 2014 at 12:05 AM, Ben Hood <0x6e6...@gmail.com> wrote: > BTW thanks and kudos go to Theo and Tyler (of the cql-rb and the > datastax python drivers respectively) for publishing encoding test > cases for the decimal type - that was quite helpful :-) Sorry, I forgot to mention the in

Re: CQL decimal encoding

2014-02-26 Thread Ben Hood
On Thu, Feb 27, 2014 at 12:01 AM, Ben Hood <0x6e6...@gmail.com> wrote: > Hopefully the gocql team can code review this soon and if that's good > to go, we'll have another CQL driver that can deal with decimals. BTW thanks and kudos go to Theo and Tyler (of the cql-rb and the datastax python driver

Re: CQL decimal encoding

2014-02-26 Thread Ben Hood
On Wed, Feb 26, 2014 at 12:10 PM, Laing, Michael wrote: > go uses 'zig-zag' encoding, perhaps that is the difference? > > > On Wed, Feb 26, 2014 at 6:52 AM, Peter Lin wrote: >> >> >> You may need to bit shift if that is the case Thanks for everybody's help, I've managed to solve the issue: the u

Re: CQL decimal encoding

2014-02-26 Thread Laing, Michael
go uses 'zig-zag' encoding, perhaps that is the difference? On Wed, Feb 26, 2014 at 6:52 AM, Peter Lin wrote: > > You may need to bit shift if that is the case > > Sent from my iPhone > > > On Feb 26, 2014, at 2:53 AM, Ben Hood <0x6e6...@gmail.com> wrote: > > > > Hey Colin, > > > >> On Tue, Feb

Re: CQL decimal encoding

2014-02-26 Thread Peter Lin
You may need to bit shift if that is the case Sent from my iPhone > On Feb 26, 2014, at 2:53 AM, Ben Hood <0x6e6...@gmail.com> wrote: > > Hey Colin, > >> On Tue, Feb 25, 2014 at 10:26 PM, Colin Blower wrote: >> It looks like you are trying to implement the Decimal type. You might want >> to s

Re: CQL decimal encoding

2014-02-25 Thread Ben Hood
Hey Colin, On Tue, Feb 25, 2014 at 10:26 PM, Colin Blower wrote: > It looks like you are trying to implement the Decimal type. You might want > to start with implementing the Integer type. The Decimal type follows pretty > easily from the Integer type. > > For example: > i = unmarchalInteger(data

Re: CQL decimal encoding

2014-02-25 Thread Colin Blower
Hey Ben, It looks like you are trying to implement the Decimal type. You might want to start with implementing the Integer type. The Decimal type follows pretty easily from the Integer type. For example: i = unmarchalInteger(data[4:]) s = decInt(data[0:4]) out = inf.newDec(i, s) On 02/24/2014 09

Re: CQL decimal encoding

2014-02-25 Thread Peter Lin
sounds like maybe the bytes aren't being converted to big endian before sending the bytes to to Cassandra. In my C# driver, this is what I do. 1. I get the bytes for the scale and unscaled value 2. I reverse both byte arrays 3. I copy the bytes to a new byte array here is the actual C# code.

Re: CQL decimal encoding

2014-02-25 Thread Ben Hood
On Tue, Feb 25, 2014 at 12:50 PM, Peter Lin wrote: > > if I have time this week, I'll try to make a patch for the spec. Can't > promise I can get to it this week, but having come across this issue with > FluentCassandra, I'd like to help others avoid it. So I may be running into an encoding bug w

Re: CQL decimal encoding

2014-02-25 Thread Peter Lin
if I have time this week, I'll try to make a patch for the spec. Can't promise I can get to it this week, but having come across this issue with FluentCassandra, I'd like to help others avoid it. On Tue, Feb 25, 2014 at 5:38 AM, Sylvain Lebresne wrote: > On Mon, Feb 24, 2014 at 8:50 PM, Theo Hul

Re: CQL decimal encoding

2014-02-25 Thread Ben Hood
Sylvain, On Tue, Feb 25, 2014 at 10:38 AM, Sylvain Lebresne wrote: > The honest answer is, no-one took the time to write that down properly and > include it in the spec. My small excuse for initially skipping it in the > spec is that the CQL data type encodings are really not different from what

Re: CQL decimal encoding

2014-02-25 Thread Sylvain Lebresne
On Mon, Feb 24, 2014 at 8:50 PM, Theo Hultberg wrote: > I don't know if it's by design or if it's by oversight that the data types > aren't part of the binary protocol specification. > The honest answer is, no-one took the time to write that down properly and include it in the spec. My small exc

Re: CQL decimal encoding

2014-02-24 Thread Ben Hood
On Mon, Feb 24, 2014 at 7:50 PM, Theo Hultberg wrote: > I don't know if it's by design or if it's by oversight that the data types > aren't part of the binary protocol specification. I had to reverse engineer > how to encode and decode all of them for the Ruby driver. There were > definitely a few

Re: CQL decimal encoding

2014-02-24 Thread Ben Hood
On Mon, Feb 24, 2014 at 7:43 PM, Paul "LeoNerd" Evans wrote: > On Mon, 24 Feb 2014 19:14:48 + > Ben Hood <0x6e6...@gmail.com> wrote: > >> So I have a question about the encoding of 0: \x00\x00\x00\x00\x00. > > The first four octets are the decimal shift (0), and the remaining ones > (one in th

Re: CQL decimal encoding

2014-02-24 Thread Theo Hultberg
I don't know if it's by design or if it's by oversight that the data types aren't part of the binary protocol specification. I had to reverse engineer how to encode and decode all of them for the Ruby driver. There were definitely a few bugs in the first few versions that could have been avoided if

Re: CQL decimal encoding

2014-02-24 Thread Paul "LeoNerd" Evans
On Mon, 24 Feb 2014 19:14:48 + Ben Hood <0x6e6...@gmail.com> wrote: > So I have a question about the encoding of 0: \x00\x00\x00\x00\x00. The first four octets are the decimal shift (0), and the remaining ones (one in this case) encode a varint - 0 in this case. So it's 0 * 10**0 literall

Re: CQL decimal encoding

2014-02-24 Thread Ben Hood
On Mon, Feb 24, 2014 at 7:02 PM, Paul "LeoNerd" Evans wrote: > On Mon, 24 Feb 2014 13:55:07 -0500 > Peter Lin wrote: > >> I did the same thing :) >> >> I inserted lots of bigDecimal in Cqlsh and read it from my C# client. >> Then I did the opposite, inserts BigDecimal from C# and query it from >>

Re: CQL decimal encoding

2014-02-24 Thread Paul "LeoNerd" Evans
On Mon, 24 Feb 2014 13:55:07 -0500 Peter Lin wrote: > I did the same thing :) > > I inserted lots of bigDecimal in Cqlsh and read it from my C# client. > Then I did the opposite, inserts BigDecimal from C# and query it from > cqlsh. Once both directions worked, I had unit tests to make sure > da

Re: CQL decimal encoding

2014-02-24 Thread Peter Lin
I did the same thing :) I inserted lots of bigDecimal in Cqlsh and read it from my C# client. Then I did the opposite, inserts BigDecimal from C# and query it from cqlsh. Once both directions worked, I had unit tests to make sure data is cross platform compatible. I know older versions of FluentC

Re: CQL decimal encoding

2014-02-24 Thread Ben Hood
Hey Paul, On Mon, Feb 24, 2014 at 6:40 PM, Paul "LeoNerd" Evans wrote: > And the unit tests live here: > > > https://metacpan.org/source/PEVANS/Protocol-CassandraCQL-0.11/t/02types.t#L111 Very cool - I'll port these examples to the gocql marshaling test suite - kudos to you for reverse engine

Re: CQL decimal encoding

2014-02-24 Thread Paul "LeoNerd" Evans
On Mon, 24 Feb 2014 17:51:54 + Ben Hood <0x6e6...@gmail.com> wrote: > Or in the absence of a spec, just a heads up from other language > driver implementors as to what approach they've taken. I reverse-engineered it by using cqlsh to insert lots of known numerical values, then seeing what the

Re: CQL decimal encoding

2014-02-24 Thread Ben Hood
On Mon, Feb 24, 2014 at 6:09 PM, Peter Lin wrote: > I took a look at the code. Java uses big endian encoding. I don't know if GO > defaults to big or little. In my port of Hector to C#, I reverse the bytes > due to the fact that .Net uses little endian. Cool - I'll take this as a spec - thanks fo

  1   2   3   4   >