You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Matt Mitchell <go...@gmail.com> on 2013/03/25 01:11:42 UTC

sql data model w/where clause

Hi,

I have a table of user preferences with the following columns:

user_id
item_id
tag

I want to build a data model in mahout, but not use the entire table. I'd
like to add a where clause like "where tag = 'A'" when building the model
instance. Is this possible? If not, any way around this besides creating a
view or new table?

Thanks,
Matt

Re: sql data model w/where clause

Posted by Sean Owen <sr...@gmail.com>.
Modify the existing code to change the SQL -- it's just a matter of
copying a class that only specifies SQL and making new SQL statements.
I think there's a version that even reads from a Properties object.

On Mon, Mar 25, 2013 at 12:11 AM, Matt Mitchell <go...@gmail.com> wrote:
> Hi,
>
> I have a table of user preferences with the following columns:
>
> user_id
> item_id
> tag
>
> I want to build a data model in mahout, but not use the entire table. I'd
> like to add a where clause like "where tag = 'A'" when building the model
> instance. Is this possible? If not, any way around this besides creating a
> view or new table?
>
> Thanks,
> Matt

Re: sql data model w/where clause

Posted by Matt Mitchell <go...@gmail.com>.
That's not a bad idea Saikat. I'll try that out. Thanks!

- Matt


On Sun, Mar 24, 2013 at 9:25 PM, Saikat Kanjilal <sx...@hotmail.com>wrote:

> Matt,
> One idea might be to create a trigger off this table that fires to return
> a subset of the records based on the tag you describe below.  Would that
> work for you?
>
> Sent from my iPhone
>
> On Mar 24, 2013, at 5:11 PM, Matt Mitchell <go...@gmail.com> wrote:
>
> > Hi,
> >
> > I have a table of user preferences with the following columns:
> >
> > user_id
> > item_id
> > tag
> >
> > I want to build a data model in mahout, but not use the entire table. I'd
> > like to add a where clause like "where tag = 'A'" when building the model
> > instance. Is this possible? If not, any way around this besides creating
> a
> > view or new table?
> >
> > Thanks,
> > Matt
>

Re: sql data model w/where clause

Posted by Saikat Kanjilal <sx...@hotmail.com>.
Matt,
One idea might be to create a trigger off this table that fires to return a subset of the records based on the tag you describe below.  Would that work for you?

Sent from my iPhone

On Mar 24, 2013, at 5:11 PM, Matt Mitchell <go...@gmail.com> wrote:

> Hi,
> 
> I have a table of user preferences with the following columns:
> 
> user_id
> item_id
> tag
> 
> I want to build a data model in mahout, but not use the entire table. I'd
> like to add a where clause like "where tag = 'A'" when building the model
> instance. Is this possible? If not, any way around this besides creating a
> view or new table?
> 
> Thanks,
> Matt