You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@accumulo.apache.org by David Medinets <da...@gmail.com> on 2012/02/23 04:17:30 UTC

Definition of Column Qualifier in User Manual

Perhaps I've overlooked it, but I don't see a definition of Column
Qualifier in the User Manual. Is there a best practice recommendation
when the data is simply row,column,value (i.e., david,age,23). Can the
qualifier or value be null?

Re: Definition of Column Qualifier in User Manual

Posted by Eric Newton <er...@gmail.com>.
It's a way of grouping columns so that they go into different index files.
 This can lead to better compression and faster query times.

-Eric

On Thu, Feb 23, 2012 at 3:22 PM, David Medinets <da...@gmail.com>wrote:

> Please elaborate. What is a locality group? Why are they important?
> Please cite examples.
>
> On Thu, Feb 23, 2012 at 3:04 PM, Keith Turner <ke...@deenlo.com> wrote:
> > One thing to consider when deciding if you want to use a column family
> > or qualifier is locality groups.  Column families can be placed in
> > locality groups.
> >
> > On Thu, Feb 23, 2012 at 2:37 PM, David Medinets
> > <da...@gmail.com> wrote:
> >> In this kind of situation, I've seen marker classes used so the intent
> >> of the parameter is clear. Marker classes also make it feasible to
> >> overload method signatures to allow for missing parameters.
> >>
> >> While you have explained using the empty string as a column qualifier,
> >> you haven't explained the column qualifier itself. I won't be
> >> misdirected so easily :)
> >>
> >> On Thu, Feb 23, 2012 at 11:55 AM, Adam Fuchs <ad...@ugov.gov>
> wrote:
> >>> When we don't have an entry for an element of the key or the value we
> >>> typically use the empty string (or zero-length byte array). This is
> >>> technically different from null, but it seems to work well for all the
> use
> >>> cases we've encountered so far. Here are some examples:
> >>>
> >>>     Mutation m = new Mutation("david");
> >>>     m.put("age","","23, no, really");
> >>>
> >>>     Mutation m = new Mutation("david");
> >>>     m.put("age","23, honest", "");
> >>>
> >>>     byte[] empty = new byte[0];
> >>>     Mutation m = new Mutation(new Text("david"));
> >>>     m.put("age","23, honest",new Value(empty));
> >>>
> >>> The first example uses a zero-length column qualifier and populates the
> >>> value. The second and third examples result in exactly the same
> entries in
> >>> Accumulo, with a populated column qualifier and a zero-length value.
> >>>
> >>> Cheers,
> >>> Adam
> >>>
> >>>
> >>> On Wed, Feb 22, 2012 at 10:17 PM, David Medinets <
> david.medinets@gmail.com>
> >>> wrote:
> >>>>
> >>>> Perhaps I've overlooked it, but I don't see a definition of Column
> >>>> Qualifier in the User Manual. Is there a best practice recommendation
> >>>> when the data is simply row,column,value (i.e., david,age,23). Can the
> >>>> qualifier or value be null?
> >>>
> >>>
>

Re: Definition of Column Qualifier in User Manual

Posted by David Medinets <da...@gmail.com>.
Please elaborate. What is a locality group? Why are they important?
Please cite examples.

On Thu, Feb 23, 2012 at 3:04 PM, Keith Turner <ke...@deenlo.com> wrote:
> One thing to consider when deciding if you want to use a column family
> or qualifier is locality groups.  Column families can be placed in
> locality groups.
>
> On Thu, Feb 23, 2012 at 2:37 PM, David Medinets
> <da...@gmail.com> wrote:
>> In this kind of situation, I've seen marker classes used so the intent
>> of the parameter is clear. Marker classes also make it feasible to
>> overload method signatures to allow for missing parameters.
>>
>> While you have explained using the empty string as a column qualifier,
>> you haven't explained the column qualifier itself. I won't be
>> misdirected so easily :)
>>
>> On Thu, Feb 23, 2012 at 11:55 AM, Adam Fuchs <ad...@ugov.gov> wrote:
>>> When we don't have an entry for an element of the key or the value we
>>> typically use the empty string (or zero-length byte array). This is
>>> technically different from null, but it seems to work well for all the use
>>> cases we've encountered so far. Here are some examples:
>>>
>>>     Mutation m = new Mutation("david");
>>>     m.put("age","","23, no, really");
>>>
>>>     Mutation m = new Mutation("david");
>>>     m.put("age","23, honest", "");
>>>
>>>     byte[] empty = new byte[0];
>>>     Mutation m = new Mutation(new Text("david"));
>>>     m.put("age","23, honest",new Value(empty));
>>>
>>> The first example uses a zero-length column qualifier and populates the
>>> value. The second and third examples result in exactly the same entries in
>>> Accumulo, with a populated column qualifier and a zero-length value.
>>>
>>> Cheers,
>>> Adam
>>>
>>>
>>> On Wed, Feb 22, 2012 at 10:17 PM, David Medinets <da...@gmail.com>
>>> wrote:
>>>>
>>>> Perhaps I've overlooked it, but I don't see a definition of Column
>>>> Qualifier in the User Manual. Is there a best practice recommendation
>>>> when the data is simply row,column,value (i.e., david,age,23). Can the
>>>> qualifier or value be null?
>>>
>>>

Re: Definition of Column Qualifier in User Manual

Posted by Keith Turner <ke...@deenlo.com>.
One thing to consider when deciding if you want to use a column family
or qualifier is locality groups.  Column families can be placed in
locality groups.

On Thu, Feb 23, 2012 at 2:37 PM, David Medinets
<da...@gmail.com> wrote:
> In this kind of situation, I've seen marker classes used so the intent
> of the parameter is clear. Marker classes also make it feasible to
> overload method signatures to allow for missing parameters.
>
> While you have explained using the empty string as a column qualifier,
> you haven't explained the column qualifier itself. I won't be
> misdirected so easily :)
>
> On Thu, Feb 23, 2012 at 11:55 AM, Adam Fuchs <ad...@ugov.gov> wrote:
>> When we don't have an entry for an element of the key or the value we
>> typically use the empty string (or zero-length byte array). This is
>> technically different from null, but it seems to work well for all the use
>> cases we've encountered so far. Here are some examples:
>>
>>     Mutation m = new Mutation("david");
>>     m.put("age","","23, no, really");
>>
>>     Mutation m = new Mutation("david");
>>     m.put("age","23, honest", "");
>>
>>     byte[] empty = new byte[0];
>>     Mutation m = new Mutation(new Text("david"));
>>     m.put("age","23, honest",new Value(empty));
>>
>> The first example uses a zero-length column qualifier and populates the
>> value. The second and third examples result in exactly the same entries in
>> Accumulo, with a populated column qualifier and a zero-length value.
>>
>> Cheers,
>> Adam
>>
>>
>> On Wed, Feb 22, 2012 at 10:17 PM, David Medinets <da...@gmail.com>
>> wrote:
>>>
>>> Perhaps I've overlooked it, but I don't see a definition of Column
>>> Qualifier in the User Manual. Is there a best practice recommendation
>>> when the data is simply row,column,value (i.e., david,age,23). Can the
>>> qualifier or value be null?
>>
>>

Re: Definition of Column Qualifier in User Manual

Posted by David Medinets <da...@gmail.com>.
In this kind of situation, I've seen marker classes used so the intent
of the parameter is clear. Marker classes also make it feasible to
overload method signatures to allow for missing parameters.

While you have explained using the empty string as a column qualifier,
you haven't explained the column qualifier itself. I won't be
misdirected so easily :)

On Thu, Feb 23, 2012 at 11:55 AM, Adam Fuchs <ad...@ugov.gov> wrote:
> When we don't have an entry for an element of the key or the value we
> typically use the empty string (or zero-length byte array). This is
> technically different from null, but it seems to work well for all the use
> cases we've encountered so far. Here are some examples:
>
>     Mutation m = new Mutation("david");
>     m.put("age","","23, no, really");
>
>     Mutation m = new Mutation("david");
>     m.put("age","23, honest", "");
>
>     byte[] empty = new byte[0];
>     Mutation m = new Mutation(new Text("david"));
>     m.put("age","23, honest",new Value(empty));
>
> The first example uses a zero-length column qualifier and populates the
> value. The second and third examples result in exactly the same entries in
> Accumulo, with a populated column qualifier and a zero-length value.
>
> Cheers,
> Adam
>
>
> On Wed, Feb 22, 2012 at 10:17 PM, David Medinets <da...@gmail.com>
> wrote:
>>
>> Perhaps I've overlooked it, but I don't see a definition of Column
>> Qualifier in the User Manual. Is there a best practice recommendation
>> when the data is simply row,column,value (i.e., david,age,23). Can the
>> qualifier or value be null?
>
>

Re: Definition of Column Qualifier in User Manual

Posted by Adam Fuchs <ad...@ugov.gov>.
When we don't have an entry for an element of the key or the value we
typically use the empty string (or zero-length byte array). This is
technically different from null, but it seems to work well for all the use
cases we've encountered so far. Here are some examples:

    Mutation m = new Mutation("david");
    m.put("age","","23, no, really");

    Mutation m = new Mutation("david");
    m.put("age","23, honest", "");

    byte[] empty = new byte[0];
    Mutation m = new Mutation(new Text("david"));
    m.put("age","23, honest",new Value(empty));

The first example uses a zero-length column qualifier and populates the
value. The second and third examples result in exactly the same entries in
Accumulo, with a populated column qualifier and a zero-length value.

Cheers,
Adam


On Wed, Feb 22, 2012 at 10:17 PM, David Medinets
<da...@gmail.com>wrote:

> Perhaps I've overlooked it, but I don't see a definition of Column
> Qualifier in the User Manual. Is there a best practice recommendation
> when the data is simply row,column,value (i.e., david,age,23). Can the
> qualifier or value be null?
>