You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Vivek Mishra <vi...@impetus.co.in> on 2011/06/16 13:55:26 UTC

Querying superColumn

I have a question about querying super column

For example:

I have a supercolumnFamily  DEPARTMENT with dynamic superColumn 'EMPLOYEE'( name, country).

Now for rowKey 'DEPT1' I have inserted multiple super column like:

Employee1{
Name: Vivek
country:  India
}

Employee2{
Name: Vivs
country:  USA
}



Now if I want to retrieve a super column whose rowkey is 'DEPT1' and  employee name is 'Vivek'. Can I get only 'EMPLOYEE1' ?



-Vivek

________________________________

Write to us for a Free Gold Pass to the Cloud Computing Expo, NYC to attend a live session by Head of Impetus Labs on 'Secrets of Building a Cloud Vendor Agnostic PetaByte Scale Real-time Secure Web Application on the Cloud '.

Looking to leverage the Cloud for your Big Data Strategy ? Attend Impetus webinar on May 27 by registering at http://www.impetus.com/webinar?eventid=42 .


NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.

Re: Querying superColumn

Posted by Sasha Dolgy <sd...@gmail.com>.
Write two records ...

1.  [department1] = { "Vivek" : "India" }
2.  [India] = { "Vivek" : "department1" }

1.  [department1] = { "Vivs" : "USA" }
2.  [USA] = { "Vivs" : "department1" }

Now you can query a single row to display all employees in USA or all
employees in department1 ... employee moves to a new department in a
new country, simply remove the column from that department row and
country row and re-insert into the new rows...

My understanding with Cassandra and similar technologies is that you
are designing to be smart and avoid data duplication.  You are
designing to address the searches and queries based on your business
requirements ... when you know what those are, you cheat and
pre-populate the data you will be searching on ...

On Fri, Jun 17, 2011 at 1:16 PM, Vivek Mishra
<vi...@impetus.co.in> wrote:
> Correct. But that will not solve issue of data colocation(data locality) ?
>
>
>
> From: Sasha Dolgy [mailto:sdolgy@gmail.com]
> Sent: Thursday, June 16, 2011 8:47 PM
> To: user@cassandra.apache.org
> Subject: Re: Querying superColumn
>
>
>
> Have 1 row with employee info for country/office/division, each column an
> employee id and json info about the employee or a reference.to.another row
> id for that employee data....
>
> No more supercolumn.
>
> On Jun 16, 2011 1:56 PM, "Vivek Mishra" <vi...@impetus.co.in> wrote:
>> I have a question about querying super column
>>
>> For example:
>>
>> I have a supercolumnFamily DEPARTMENT with dynamic superColumn 'EMPLOYEE'(
>> name, country).
>>
>> Now for rowKey 'DEPT1' I have inserted multiple super column like:
>>
>> Employee1{
>> Name: Vivek
>> country: India
>> }
>>
>> Employee2{
>> Name: Vivs
>> country: USA
>> }
>>
>>
>>
>> Now if I want to retrieve a super column whose rowkey is 'DEPT1' and
>> employee name is 'Vivek'. Can I get only 'EMPLOYEE1' ?
>>
>>
>>
>> -Vivek
>>
>> ________________________________
>>
>> Write to us for a Free Gold Pass to the Cloud Computing Expo, NYC to
>> attend a live session by Head of Impetus Labs on 'Secrets of Building a
>> Cloud Vendor Agnostic PetaByte Scale Real-time Secure Web Application on the
>> Cloud '.
>>
>> Looking to leverage the Cloud for your Big Data Strategy ? Attend Impetus
>> webinar on May 27 by registering at
>> http://www.impetus.com/webinar?eventid=42 .
>>
>>
>> NOTE: This message may contain information that is confidential,
>> proprietary, privileged or otherwise protected by law. The message is
>> intended solely for the named addressee. If received in error, please
>> destroy and notify the sender. Any use of this email is prohibited when
>> received in error. Impetus does not represent, warrant and/or guarantee,
>> that the integrity of this communication has been maintained nor that the
>> communication is free of errors, virus, interception or interference.
>
> ________________________________
> Write to us for a Free Gold Pass to the Cloud Computing Expo, NYC to attend
> a live session by Head of Impetus Labs on ‘Secrets of Building a Cloud
> Vendor Agnostic PetaByte Scale Real-time Secure Web Application on the Cloud
> ‘.
>
> Looking to leverage the Cloud for your Big Data Strategy ? Attend Impetus
> webinar on May 27 by registering at
> http://www.impetus.com/webinar?eventid=42 .
>
>
> NOTE: This message may contain information that is confidential,
> proprietary, privileged or otherwise protected by law. The message is
> intended solely for the named addressee. If received in error, please
> destroy and notify the sender. Any use of this email is prohibited when
> received in error. Impetus does not represent, warrant and/or guarantee,
> that the integrity of this communication has been maintained nor that the
> communication is free of errors, virus, interception or interference.
>



-- 
Sasha Dolgy
sasha.dolgy@gmail.com

RE: Querying superColumn

Posted by Vivek Mishra <vi...@impetus.co.in>.
Correct. But that will not solve issue of data colocation(data locality) ?

From: Sasha Dolgy [mailto:sdolgy@gmail.com]
Sent: Thursday, June 16, 2011 8:47 PM
To: user@cassandra.apache.org
Subject: Re: Querying superColumn


Have 1 row with employee info for country/office/division, each column an employee id and json info about the employee or a reference.to.another row id for that employee data....

No more supercolumn.
On Jun 16, 2011 1:56 PM, "Vivek Mishra" <vi...@impetus.co.in>> wrote:
> I have a question about querying super column
>
> For example:
>
> I have a supercolumnFamily DEPARTMENT with dynamic superColumn 'EMPLOYEE'( name, country).
>
> Now for rowKey 'DEPT1' I have inserted multiple super column like:
>
> Employee1{
> Name: Vivek
> country: India
> }
>
> Employee2{
> Name: Vivs
> country: USA
> }
>
>
>
> Now if I want to retrieve a super column whose rowkey is 'DEPT1' and employee name is 'Vivek'. Can I get only 'EMPLOYEE1' ?
>
>
>
> -Vivek
>
> ________________________________
>
> Write to us for a Free Gold Pass to the Cloud Computing Expo, NYC to attend a live session by Head of Impetus Labs on 'Secrets of Building a Cloud Vendor Agnostic PetaByte Scale Real-time Secure Web Application on the Cloud '.
>
> Looking to leverage the Cloud for your Big Data Strategy ? Attend Impetus webinar on May 27 by registering at http://www.impetus.com/webinar?eventid=42 .
>
>
> NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.

________________________________

Write to us for a Free Gold Pass to the Cloud Computing Expo, NYC to attend a live session by Head of Impetus Labs on 'Secrets of Building a Cloud Vendor Agnostic PetaByte Scale Real-time Secure Web Application on the Cloud '.

Looking to leverage the Cloud for your Big Data Strategy ? Attend Impetus webinar on May 27 by registering at http://www.impetus.com/webinar?eventid=42 .


NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.

Re: Querying superColumn

Posted by Sasha Dolgy <sd...@gmail.com>.
Have 1 row with employee info for country/office/division, each column an
employee id and json info about the employee or a reference.to.another row
id for that employee data....

No more supercolumn.
On Jun 16, 2011 1:56 PM, "Vivek Mishra" <vi...@impetus.co.in> wrote:
> I have a question about querying super column
>
> For example:
>
> I have a supercolumnFamily DEPARTMENT with dynamic superColumn 'EMPLOYEE'(
name, country).
>
> Now for rowKey 'DEPT1' I have inserted multiple super column like:
>
> Employee1{
> Name: Vivek
> country: India
> }
>
> Employee2{
> Name: Vivs
> country: USA
> }
>
>
>
> Now if I want to retrieve a super column whose rowkey is 'DEPT1' and
employee name is 'Vivek'. Can I get only 'EMPLOYEE1' ?
>
>
>
> -Vivek
>
> ________________________________
>
> Write to us for a Free Gold Pass to the Cloud Computing Expo, NYC to
attend a live session by Head of Impetus Labs on 'Secrets of Building a
Cloud Vendor Agnostic PetaByte Scale Real-time Secure Web Application on the
Cloud '.
>
> Looking to leverage the Cloud for your Big Data Strategy ? Attend Impetus
webinar on May 27 by registering at
http://www.impetus.com/webinar?eventid=42 .
>
>
> NOTE: This message may contain information that is confidential,
proprietary, privileged or otherwise protected by law. The message is
intended solely for the named addressee. If received in error, please
destroy and notify the sender. Any use of this email is prohibited when
received in error. Impetus does not represent, warrant and/or guarantee,
that the integrity of this communication has been maintained nor that the
communication is free of errors, virus, interception or interference.

Re: Querying superColumn

Posted by Donal Zang <za...@ihep.ac.cn>.
Well, you are looking for the secondary index.
But for now,AFAIK, the supercolumn can not use secondary index .
On 16/06/2011 13:55, Vivek Mishra wrote:
>
> Now for rowKey 'DEPT1' I have inserted multiple super column like:
>
> *Employee1{*
>
> *Name: Vivek*
>
> *country:  India*
>
> *}*
>
> **
>
> *Employee2{*
>
> *Name: Vivs*
>
> *country:  USA*
>
> *}*
>
> Now if I want to retrieve a super column whose rowkey is 'DEPT1' and  
> employee name is 'Vivek'. Can I get only 'EMPLOYEE1' ?
>


-- 
Donal Zang
Computing Center, IHEP
19B YuquanLu, Shijingshan District,Beijing, 100049
zangds@ihep.ac.cn
86 010 8823 6018