Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composite Columns Key Retrieval #19

Open
larsx2 opened this issue Feb 6, 2013 · 8 comments
Open

Composite Columns Key Retrieval #19

larsx2 opened this issue Feb 6, 2013 · 8 comments

Comments

@larsx2
Copy link

larsx2 commented Feb 6, 2013

Is there any way to retrieve rows with a CompositeType as key on perlcassa? I have not seen that use case on the examples yet.

@mkjellman
Copy link
Owner

Could you post a cf schema that your looking to query just to make sure i totally understand the request? Thanks

@larsx2
Copy link
Author

larsx2 commented Feb 6, 2013

Let's suppose i want to retrieve a row with this key:

RowKey: 2009-04-19 22:40:25-0900:smtp.usma.bluenet.:10.1.60.25:A:167853061:667da0075b5a14c65eff0b25308cf072
=> (column=answer, value=10.1.60.25, timestamp=1359759908728109)
....

The row key is made from multiple columns (date, query, answer, type, dst_ip, checksum)
the Column Family in this case is defined as:

CREATE COLUMN FAMILY dns WITH comparator = 'UTF8Type'
AND key_validation_class = 'CompositeType(DateType, UTF8Type, UTF8Type, UTF8Type, DecimalType, UTF8Type)'
AND compression_options = {sstable_compression: SnappyCompressor} and column_metadata = [
{column_name: src_ip, validation_class: DecimalType},
{column_name: dst_ip, validation_class: DecimalType},
{column_name: query, validation_class: UTF8Type},
{column_name: type, validation_class: UTF8Type},
{column_name: answer, validation_class: UTF8Type},
{column_name: rr_class, validation_class: UTF8Type},
{column_name: date, validation_class: DateType},
{column_name: checksum, validation_class: UTF8Type}
];

As described, how would i fetch an specific row using perlcassa?

@mkjellman
Copy link
Owner

honestly, I never thought of using a CompositeType in a key. I assume your just doing that to validate your input for the key name?

Should be pretty easy for me to add in though.

@larsx2
Copy link
Author

larsx2 commented Feb 7, 2013

It would be AWESOME if you can add support for it :)

@dmcnelis
Copy link

@mkjellman Do you still plan to implement this, and if so, any idea when you might get to it?

@mkjellman
Copy link
Owner

@dmcnelis apologies on the delay. i'll try to get something committed into trunk todayish

@dmcnelis
Copy link

Awesomeness!

@swatidhoke
Copy link

Hi ... this would be great..can you also add support for row key as long data type ..i have also added my issue separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants