You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Vikas Agarwal <vi...@infoobjects.com> on 2015/02/16 16:10:43 UTC

Query for One-to-Many relationship

Hi,

I was looking for query and Java code for the data model represented here
<http://wiki.apache.org/hadoop/Hbase/DataModel>.

Example query:

select info.title, comment_title.*, comment_author.* from blogtable where
rowkey=<some_row_key>;

Now how would we store the result in Java data structures? I don't think it
would return array of comment_title, comment_author. I am wondering if
somehow we can gather results as proper object hierarchy like

{
    title: <blog title>,
    comments: [
        {
            title: <comment_title>,
            author: <comment_author>
        }
    ]
}

-- 
Regards,
Vikas Agarwal
91 – 9928301411

InfoObjects, Inc.
Execution Matters
http://www.infoobjects.com
2041 Mission College Boulevard, #280
Santa Clara, CA 95054
+1 (408) 988-2000 Work
+1 (408) 716-2726 Fax

Re: Query for One-to-Many relationship

Posted by Vikas Agarwal <vi...@infoobjects.com>.
Anybody? If the feature is not supported yet, I would like to contribute
given some pointers to start with.

On Mon, Feb 16, 2015 at 8:40 PM, Vikas Agarwal <vi...@infoobjects.com>
wrote:

> Hi,
>
> I was looking for query and Java code for the data model represented here
> <http://wiki.apache.org/hadoop/Hbase/DataModel>.
>
> Example query:
>
> select info.title, comment_title.*, comment_author.* from blogtable where
> rowkey=<some_row_key>;
>
> Now how would we store the result in Java data structures? I don't think
> it would return array of comment_title, comment_author. I am wondering if
> somehow we can gather results as proper object hierarchy like
>
> {
>     title: <blog title>,
>     comments: [
>         {
>             title: <comment_title>,
>             author: <comment_author>
>         }
>     ]
> }
>
> --
> Regards,
> Vikas Agarwal
> 91 – 9928301411
>
> InfoObjects, Inc.
> Execution Matters
> http://www.infoobjects.com
> 2041 Mission College Boulevard, #280
> Santa Clara, CA 95054
> +1 (408) 988-2000 Work
> +1 (408) 716-2726 Fax
>
>


-- 
Regards,
Vikas Agarwal
91 – 9928301411

InfoObjects, Inc.
Execution Matters
http://www.infoobjects.com
2041 Mission College Boulevard, #280
Santa Clara, CA 95054
+1 (408) 988-2000 Work
+1 (408) 716-2726 Fax