You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Vivekanand Ittigi <vi...@biginfolabs.com> on 2014/06/12 07:38:53 UTC

Implementing Hive query in Solr

Hi,

My requirements is to execute this query(hive) in solr:

select SUM(Primary_cause_vaR),collect_set(skuType),RiskType,market,
collect_set(primary_cause) from bil_tos Where skuType='Product' group by
RiskType,market;

I can implement sum and groupBy operations in solr using StatsComponent
concept but i've no idea to implement collect_set() in solr.

Collect_set() is used in Hive queries.
Please provide me equivalent function for collect_set in solr or links or
how to achieve it. It'd be a great help.


Thanks,
Vivek

Re: Implementing Hive query in Solr

Posted by Joel Bernstein <jo...@gmail.com>.
Yeah, solr-jdbc does look interesting. Has an Apache license as well.

Joel Bernstein
Search Engineer at Heliosearch


On Thu, Jun 12, 2014 at 1:18 PM, Mikhail Khludnev <
mkhludnev@griddynamics.com> wrote:

> Hello,
>
> I've found https://github.com/kawasima/solr-jdbc recently. Haven't checked
> it so far, but the idea is fairly cool. I wonder if it can be relevant to
> your challenge.
>
>
> On Thu, Jun 12, 2014 at 9:38 AM, Vivekanand Ittigi <vi...@biginfolabs.com>
> wrote:
>
> > Hi,
> >
> > My requirements is to execute this query(hive) in solr:
> >
> > select SUM(Primary_cause_vaR),collect_set(skuType),RiskType,market,
> > collect_set(primary_cause) from bil_tos Where skuType='Product' group by
> > RiskType,market;
> >
> > I can implement sum and groupBy operations in solr using StatsComponent
> > concept but i've no idea to implement collect_set() in solr.
> >
> > Collect_set() is used in Hive queries.
> > Please provide me equivalent function for collect_set in solr or links or
> > how to achieve it. It'd be a great help.
> >
> >
> > Thanks,
> > Vivek
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
>  <mk...@griddynamics.com>
>

Re: Implementing Hive query in Solr

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Hello,

I've found https://github.com/kawasima/solr-jdbc recently. Haven't checked
it so far, but the idea is fairly cool. I wonder if it can be relevant to
your challenge.


On Thu, Jun 12, 2014 at 9:38 AM, Vivekanand Ittigi <vi...@biginfolabs.com>
wrote:

> Hi,
>
> My requirements is to execute this query(hive) in solr:
>
> select SUM(Primary_cause_vaR),collect_set(skuType),RiskType,market,
> collect_set(primary_cause) from bil_tos Where skuType='Product' group by
> RiskType,market;
>
> I can implement sum and groupBy operations in solr using StatsComponent
> concept but i've no idea to implement collect_set() in solr.
>
> Collect_set() is used in Hive queries.
> Please provide me equivalent function for collect_set in solr or links or
> how to achieve it. It'd be a great help.
>
>
> Thanks,
> Vivek
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
 <mk...@griddynamics.com>

Re: Implementing Hive query in Solr

Posted by Joel Bernstein <jo...@gmail.com>.
You may have to implement this yourself. In Solr 4.9 you'll be able to
implement your own analytic functions in java and plug them in using the
AnalyticsQuery API. This is a new Solr API for plugging in custom
analytics.

http://heliosearch.org/solrs-new-analyticsquery-api/

Joel Bernstein
Search Engineer at Heliosearch


On Thu, Jun 12, 2014 at 10:27 AM, Erick Erickson <er...@gmail.com>
wrote:

> Any time I see a question like this I break out in hives (little pun
> there).
> Solr is _not_ a replacement for Hive. Or any other SQL or SQL-like
> engine. Trying to make it into one is almost always a mistake. First I'd
> ask
> why you have to form this query.
>
> Now, while I have very little knowledge of HIve, collect_set "removes
> duplicates"
> Why do you have duplicates in the first place?
>
> Best,
> Erick
>
> On Thu, Jun 12, 2014 at 7:12 AM, Vivekanand Ittigi
> <vi...@biginfolabs.com> wrote:
> > Hi,
> >
> > Can anyone please look into this issue. I want to implement this query in
> > solr.
> >
> > Thanks,
> > Vivek
> >
> > ---------- Forwarded message ----------
> > From: Vivekanand Ittigi <vi...@biginfolabs.com>
> > Date: Thu, Jun 12, 2014 at 11:08 AM
> > Subject: Implementing Hive query in Solr
> > To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> >
> >
> > Hi,
> >
> > My requirements is to execute this query(hive) in solr:
> >
> > select SUM(Primary_cause_vaR),collect_set(skuType),RiskType,market,
> > collect_set(primary_cause) from bil_tos Where skuType='Product' group by
> > RiskType,market;
> >
> > I can implement sum and groupBy operations in solr using StatsComponent
> > concept but i've no idea to implement collect_set() in solr.
> >
> > Collect_set() is used in Hive queries.
> > Please provide me equivalent function for collect_set in solr or links or
> > how to achieve it. It'd be a great help.
> >
> >
> > Thanks,
> > Vivek
>

Re: Implementing Hive query in Solr

Posted by Vivekanand Ittigi <vi...@biginfolabs.com>.
Hi Erick,

We are actually comparing the speed of search. We are trying to run this
few hive queries in solr. We are if we can implement this in solr
definitely we can migrate our system into solr.

Can you please look at this issue also
http://stackoverflow.com/questions/24202798/sum-and-groupby-in-solr

Here we are removing collect_set() concept.

Thanks,
Vivek


On Thu, Jun 12, 2014 at 7:57 PM, Erick Erickson <er...@gmail.com>
wrote:

> Any time I see a question like this I break out in hives (little pun
> there).
> Solr is _not_ a replacement for Hive. Or any other SQL or SQL-like
> engine. Trying to make it into one is almost always a mistake. First I'd
> ask
> why you have to form this query.
>
> Now, while I have very little knowledge of HIve, collect_set "removes
> duplicates"
> Why do you have duplicates in the first place?
>
> Best,
> Erick
>
> On Thu, Jun 12, 2014 at 7:12 AM, Vivekanand Ittigi
> <vi...@biginfolabs.com> wrote:
> > Hi,
> >
> > Can anyone please look into this issue. I want to implement this query in
> > solr.
> >
> > Thanks,
> > Vivek
> >
> > ---------- Forwarded message ----------
> > From: Vivekanand Ittigi <vi...@biginfolabs.com>
> > Date: Thu, Jun 12, 2014 at 11:08 AM
> > Subject: Implementing Hive query in Solr
> > To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> >
> >
> > Hi,
> >
> > My requirements is to execute this query(hive) in solr:
> >
> > select SUM(Primary_cause_vaR),collect_set(skuType),RiskType,market,
> > collect_set(primary_cause) from bil_tos Where skuType='Product' group by
> > RiskType,market;
> >
> > I can implement sum and groupBy operations in solr using StatsComponent
> > concept but i've no idea to implement collect_set() in solr.
> >
> > Collect_set() is used in Hive queries.
> > Please provide me equivalent function for collect_set in solr or links or
> > how to achieve it. It'd be a great help.
> >
> >
> > Thanks,
> > Vivek
>

Re: Implementing Hive query in Solr

Posted by Erick Erickson <er...@gmail.com>.
Any time I see a question like this I break out in hives (little pun there).
Solr is _not_ a replacement for Hive. Or any other SQL or SQL-like
engine. Trying to make it into one is almost always a mistake. First I'd ask
why you have to form this query.

Now, while I have very little knowledge of HIve, collect_set "removes
duplicates"
Why do you have duplicates in the first place?

Best,
Erick

On Thu, Jun 12, 2014 at 7:12 AM, Vivekanand Ittigi
<vi...@biginfolabs.com> wrote:
> Hi,
>
> Can anyone please look into this issue. I want to implement this query in
> solr.
>
> Thanks,
> Vivek
>
> ---------- Forwarded message ----------
> From: Vivekanand Ittigi <vi...@biginfolabs.com>
> Date: Thu, Jun 12, 2014 at 11:08 AM
> Subject: Implementing Hive query in Solr
> To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
>
>
> Hi,
>
> My requirements is to execute this query(hive) in solr:
>
> select SUM(Primary_cause_vaR),collect_set(skuType),RiskType,market,
> collect_set(primary_cause) from bil_tos Where skuType='Product' group by
> RiskType,market;
>
> I can implement sum and groupBy operations in solr using StatsComponent
> concept but i've no idea to implement collect_set() in solr.
>
> Collect_set() is used in Hive queries.
> Please provide me equivalent function for collect_set in solr or links or
> how to achieve it. It'd be a great help.
>
>
> Thanks,
> Vivek

Fwd: Implementing Hive query in Solr

Posted by Vivekanand Ittigi <vi...@biginfolabs.com>.
Hi,

Can anyone please look into this issue. I want to implement this query in
solr.

Thanks,
Vivek

---------- Forwarded message ----------
From: Vivekanand Ittigi <vi...@biginfolabs.com>
Date: Thu, Jun 12, 2014 at 11:08 AM
Subject: Implementing Hive query in Solr
To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>


Hi,

My requirements is to execute this query(hive) in solr:

select SUM(Primary_cause_vaR),collect_set(skuType),RiskType,market,
collect_set(primary_cause) from bil_tos Where skuType='Product' group by
RiskType,market;

I can implement sum and groupBy operations in solr using StatsComponent
concept but i've no idea to implement collect_set() in solr.

Collect_set() is used in Hive queries.
Please provide me equivalent function for collect_set in solr or links or
how to achieve it. It'd be a great help.


Thanks,
Vivek