kundera icon indicating copy to clipboard operation
kundera copied to clipboard

Need Indexing on collection

Open Gargee opened this issue 13 years ago • 18 comments

Hi, I need to have index built on collection .I have a column family where in one the column is a collection(set).Need some way to index this. My columnfamily looks like this:-

CREATE TABLE "ChangeRequestLog" ( "ChangeRequestID" uuid, "ChangeStatusID" int, "ChangeRequestCreateDateTime" timestamp, "ChangeRequestUpdateDateTime" timestamp, "SubmissionID" uuid, "SubmissionDateTime" timestamp, "SKUGroupID" int, "CreateUser" varchar, "UpdateUser" varchar, "PhotoID" set "<"uuid">", PRIMARY KEY("ChangeRequestID", "SubmissionID") );

Thanks Gargee

Gargee avatar Jul 16 '13 15:07 Gargee

Could you please elaborate more on this use case? In

CREATE TABLE "ChangeRequestLog" ( "ChangeRequestID" uuid, "ChangeStatusID" int, "ChangeRequestCreateDateTime" timestamp, "ChangeRequestUpdateDateTime" timestamp,
"SubmissionID" uuid, "SubmissionDateTime" timestamp, "SKUGroupID" int, "CreateUser" varchar, "UpdateUser" varchar, "PhotoID" set , PRIMARY KEY("ChangeRequestID", "SubmissionID") );

which column contains Collection(set)?

-Vivek

mevivs avatar Jul 16 '13 15:07 mevivs

oh the "< tag " is not visible in my last post ... so we have PhotoID set"<"uuid">" column which is the collection.

Gargee avatar Jul 16 '13 16:07 Gargee

Yes. But data type in Cassandra for "Photos" values?

-Vivek

mevivs avatar Jul 16 '13 17:07 mevivs

it will be time based UUID .

Gargee avatar Jul 16 '13 17:07 Gargee

Ok. bit confusing. You want to store a collection attribute within UUID type, not sure about this?

Else, to create index on TimeUUID field, it should work with:

CREATE INDEX index_name ON keyspace_name.table_name ( column_name ).

mevivs avatar Jul 17 '13 08:07 mevivs

Hi Vivek, I have 2 questions:- 1.Is there a way to create indexes on a collection type (set) in Cassandra?

CREATE TABLE "ChangeRequest" ( "ChangeRequestID" uuid, "ChangeStatusID" int, "ChangeRequestCreateDateTime" timestamp, "ChangeRequestUpdateDateTime" timestamp,

"SubmissionID" uuid, "SubmissionDateTime" timestamp, "SKUGroupID" int, "CreateUser" varchar, "UpdateUser" varchar, "PhotoID" set , PRIMARY KEY("ChangeRequestID", "SubmissionID") );

Here the "PhotoID" set "<"uuid">" is the collection column

2.Does Kundera support collection types on cassandra?

From: Vivek Mishra <[email protected]mailto:[email protected]> Reply-To: impetus-opensource/Kundera <[email protected]mailto:[email protected]> Date: Wednesday, July 17, 2013 1:25 AM To: impetus-opensource/Kundera <[email protected]mailto:[email protected]> Cc: Gargee Banerjee <[email protected]mailto:[email protected]> Subject: Re: [Kundera] Need Indexing on collection (#326)

Ok. bit confusing. You want to store a collection attribute within UUID type, not sure about this?

Else, to create index on TimeUUID field, it should work with:

CREATE INDEX index_name ON keyspace_name.table_name ( column_name ).

— Reply to this email directly or view it on GitHubhttps://github.com/impetus-opensource/Kundera/issues/326#issuecomment-21098664.

Gargee avatar Jul 17 '13 15:07 Gargee

1.Is there a way to create indexes on a collection type (set) in Cassandra?

Not supported by Cassandra.

2.Does Kundera support collection types on cassandra?

Nope. Currently it is supported via association only. Please refer https://github.com/impetus-opensource/Kundera/issues/219.

-Vivek

mevivs avatar Jul 17 '13 16:07 mevivs

ok thanks ..please update us when we have collections supported in Kundera for cassandra.

Gargee avatar Jul 17 '13 21:07 Gargee

Ok. Kindly let me know, your use case, Kundera usage and priority of this task?

-Vivek

mevivs avatar Jul 18 '13 12:07 mevivs

Hi Vivek, We need this for our customer facing application for a critical project in our company.We had planned to roll this code to production by July end. My use-case demands me to save a collections of ids which are searchable.

Gargee avatar Jul 18 '13 15:07 Gargee

Hi Gargee, Will discuss within team for this support. But indexing over collection attribute is not yet supported by Cassandra itself!

-Vivek

mevivs avatar Jul 18 '13 15:07 mevivs

Ya I figured that out. But at least if we get Kundera to support collection (rather than through association) it will be nice. As the collection set we are planning won't be very big may be we need to fetch the collection for now from DB and find it in our application … With kundera's support for collection things will be easier to implement.

From: Vivek Mishra <[email protected]mailto:[email protected]> Reply-To: impetus-opensource/Kundera <[email protected]mailto:[email protected]> Date: Thursday, July 18, 2013 8:26 AM To: impetus-opensource/Kundera <[email protected]mailto:[email protected]> Cc: Gargee Banerjee <[email protected]mailto:[email protected]> Subject: Re: [Kundera] Need Indexing on collection (#326)

Hi Gargee, Will discuss within team for this support. But indexing over collection attribute is not yet supported by Cassandra itself!

-Vivek

— Reply to this email directly or view it on GitHubhttps://github.com/impetus-opensource/Kundera/issues/326#issuecomment-21191464.

Gargee avatar Jul 18 '13 15:07 Gargee

Hi, We are assessing this support. Could you please share a maximum date by which this can wait to be delivered?

-Vivek

mevivs avatar Jul 23 '13 06:07 mevivs

hi Vivek, we can max wait till Aug first week.

Gargee avatar Jul 23 '13 20:07 Gargee

Hi Gargee, Collection support over Cassandra has been added. Please refer: https://github.com/impetus-opensource/Kundera/issues/219#issuecomment-21936137

I would suggest you to give it a try and let us know, if came across to know about any issue.

-Vivek

mevivs avatar Aug 01 '13 14:08 mevivs

Hi Gargee, Did you get a chance to test this feature. I understand that you needed for your production release.

-Vivek

mevivs avatar Aug 06 '13 17:08 mevivs

Are we good to close on this? Working fine with 2.6.1 ?

-Vivek

mevivs avatar Aug 23 '13 14:08 mevivs

We are just testing the feature and will let you know asap.

Gargee avatar Aug 23 '13 15:08 Gargee