You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Tawarien <Ru...@arcor.de> on 2013/10/29 12:41:17 UTC

Count Columnfamily

Hey, i am new to HBase an NoSQL-Databases in general.
I hope you can help me with my question!

I created a litte Table like this:

create 'blog', 'post', 'comment'

And filled it with stuff like that:

put 'blog' ,'post1', 'post:title', 'Post1-Title'
put 'blog' ,'post1', 'post:content', 'This is a Post-Content'
put 'blog' ,'post1', 'post:date', '01.12.2012'
put 'blog' ,'post1', 'comment:date', '01.01.2013'
put 'blog' ,'post1', 'comment:content', 'This is a comment'
put 'blog' ,'post1', 'comment:date', '01.02.2013'
put 'blog' ,'post1', 'comment:content', 'This is a second comment'

put 'blog' ,'post2', 'post:title', 'Post2-Title'
put 'blog' ,'post2', 'post:content', 'This is another Post-Content.'
put 'blog' ,'post2', 'post:date', '23.10.2013'
put 'blog' ,'post2', 'comment:date', '01.02.2013'
put 'blog' ,'post2', 'comment:content', 'This is another comment'


With "scan 'blog', {VERSIONS => 2}" i can, of course, get the posts and the
comments.
And with "count blog" i get the Number of Post in the Blog.


My Problem is:

I want a List with the names of the Posts with the Number of Comments given
to it,
but i am not sure how to do this.

Thanks for any Help!



--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Count-Columnfamily-tp4052286.html
Sent from the HBase User mailing list archive at Nabble.com.

Re: Count Columnfamily

Posted by Ted Yu <yu...@gmail.com>.
You can utilize ColumnPrefixFilter and do aggregation either on client side
or through custom endpoint coprocessor.

Cheers


On Tue, Oct 29, 2013 at 4:41 AM, Tawarien <Ru...@arcor.de> wrote:

> Hey, i am new to HBase an NoSQL-Databases in general.
> I hope you can help me with my question!
>
> I created a litte Table like this:
>
> create 'blog', 'post', 'comment'
>
> And filled it with stuff like that:
>
> put 'blog' ,'post1', 'post:title', 'Post1-Title'
> put 'blog' ,'post1', 'post:content', 'This is a Post-Content'
> put 'blog' ,'post1', 'post:date', '01.12.2012'
> put 'blog' ,'post1', 'comment:date', '01.01.2013'
> put 'blog' ,'post1', 'comment:content', 'This is a comment'
> put 'blog' ,'post1', 'comment:date', '01.02.2013'
> put 'blog' ,'post1', 'comment:content', 'This is a second comment'
>
> put 'blog' ,'post2', 'post:title', 'Post2-Title'
> put 'blog' ,'post2', 'post:content', 'This is another Post-Content.'
> put 'blog' ,'post2', 'post:date', '23.10.2013'
> put 'blog' ,'post2', 'comment:date', '01.02.2013'
> put 'blog' ,'post2', 'comment:content', 'This is another comment'
>
>
> With "scan 'blog', {VERSIONS => 2}" i can, of course, get the posts and the
> comments.
> And with "count blog" i get the Number of Post in the Blog.
>
>
> My Problem is:
>
> I want a List with the names of the Posts with the Number of Comments given
> to it,
> but i am not sure how to do this.
>
> Thanks for any Help!
>
>
>
> --
> View this message in context:
> http://apache-hbase.679495.n3.nabble.com/Count-Columnfamily-tp4052286.html
> Sent from the HBase User mailing list archive at Nabble.com.
>