cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Yaskevich (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (CASSANDRA-2474) CQL support for compound columns
Date Fri, 02 Sep 2011 11:18:10 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13095913#comment-13095913
] 

Pavel Yaskevich edited comment on CASSANDRA-2474 at 9/2/11 11:16 AM:
---------------------------------------------------------------------

bq. We already have the transposition as a visual "hint" as to what is going on. I don't think
it's difficult to say that "you need to use componentX when using transposition," and :colon
tokens are usually used to represent bind variables in SQL drivers.

I didn't use ":transposed" keyword any where but I'm file using it instead of :colon tokens.
I don't like "componentX" notation because we can simply preserve ordering of the arguments
to make the same thing which is much clearer syntax on my opinion

bq. Maybe it is better if we will support (..,..,..) notation for composite columns

Can be used as a replacement for "componentX" 

bq. Sorry, I don't follow.

You wrote:

bq. If I wanted to add a location tweet field, I'd need to delete (e.g.) the 2e1c3308,cscotta
column and replace it with 2e1c3308,cscotta,<location>. So, generally not recommended...
but the composite column spec implies we should support it.) Which brings us to: how to deal
with insert/update in composite columns.

I mean when we want to extend "2e1c3308,cscotta" with <location> we can simply update
old column's name to "2e1c3308,cscotta,<location>", for querying we can use "1/0/-1"
as <'end-of-component' byte> from CompositeType doc when we want to search by specific
components of the column name.

e.g. (if I understand CompositeType annotation correctly)

{noformat}
SELECT name AS (tweet_id, username), value AS body
FROM timeline
WHERE tweet_id = '95a789a' AND user_id = 'cscotta'
{noformat} 

start = "<7>95a789a.getBytes()<0><7>cscotta.getBytes()<0>"
end   = "<7>95a789a.getBytes()<0><7>cscotta.getBytes()<1>"

Which should give as *all* columns where column name starts with 95a789a,cscotta
 
{noformat}
SELECT name AS (tweet_id, username, location), value AS body
FROM timeline
WHERE tweet_id = '95a789a' AND user_id = 'cscotta' AND location = 'USA'
{noformat}

start = "<7>95a789a.getBytes()<0><7>cscotta.getBytes()<0><3>USA.getBytes()<0>"
end   = "<7>95a789a.getBytes()<0><7>cscotta.getBytes()<0><3>USA.getBytes()<1>"

Which should give as *all* columns where column name starts with 95a789a,cscotta,USA




      was (Author: xedin):
    bq. We already have the transposition as a visual "hint" as to what is going on. I don't
think it's difficult to say that "you need to use componentX when using transposition," and
:colon tokens are usually used to represent bind variables in SQL drivers.

I didn't use ":transposed" keyword any where but I'm file using it instead of :colon tokens.
I don't like "componentX" notation because we can simply preserve ordering of the arguments
to make the same thing which is much clearer syntax on my opinion

bq. Maybe it is better if we will support (..,..,..) notation for composite columns

Can be used as a replacement for "componentX" 

bq. Sorry, I don't follow.

You wrote:

bq. If I wanted to add a location tweet field, I'd need to delete (e.g.) the 2e1c3308,cscotta
column and replace it with 2e1c3308,cscotta,<location>. So, generally not recommended...
but the composite column spec implies we should support it.) Which brings us to: how to deal
with insert/update in composite columns.

I mean when we want to extend "2e1c3308,cscotta" with <location> we can simply update
old column's name to "2e1c3308,cscotta,<location>", for querying we can use "1/0/-1"
as <'end-of-component' byte> from CompositeType doc when we want to search by specific
components of the column name.

e.g. (if I understand CompositeType annotation correctly)

{noformat}
SELECT name AS (tweet_id, username), value AS body
FROM timeline
WHERE tweet_id = '95a789a' AND user_id = 'cscotta'
{noformat} 

start = "<7>95a789a.getBytes()<0><7>cscotta.getBytes()<0>"
end   = "<7>95a789a.getBytes()<0><7>cscotta.getBytes()<1>"

Which should give as *all* columns where column name starts with 95a789a,cscotta
 
{noformat}
SELECT name AS (tweet_id, username, location), value AS body
FROM timeline
WHERE tweet_id = '95a789a' AND user_id = 'cscotta' AND location = 'USA'
{noformat}

start = "<7>95a789a.getBytes()<0><7>cscotta.getBytes()<0><3>USA.getBytes()<0>"
end   = "<7>95a789a.getBytes()<0><7>cscotta.getBytes()<1><3>USA.getBytes()<1>"

Which should give as *all* columns where column name starts with 95a789a,cscotta,USA



  
> CQL support for compound columns
> --------------------------------
>
>                 Key: CASSANDRA-2474
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2474
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API, Core
>            Reporter: Eric Evans
>            Assignee: Pavel Yaskevich
>              Labels: cql
>             Fix For: 1.0
>
>         Attachments: screenshot-1.jpg, screenshot-2.jpg
>
>
> For the most part, this boils down to supporting the specification of compound column
names (the CQL syntax is colon-delimted terms), and then teaching the decoders (drivers) to
create structures from the results.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message