hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xuefu Zhang <xzh...@cloudera.com>
Subject Re: hive partition questions
Date Mon, 24 Mar 2014 22:53:19 GMT
You may try:

select * from page_view as PV1 where PV1.dt IN (select max(dt) from
page_view);


--Xuefu


On Mon, Mar 24, 2014 at 3:47 PM, Darapaneni, Hazarath <hdarapaneni@ea.com>wrote:

> Thanks Zhang,
>
> Is there a way to access ma partition in hive without specifying as value.
> Like as sub query .. select * from page_view where dt=(select max(dt) from
> page_view)..i tried this but its failing with syntax.
>
> Thanks,
> Hazarath.
>
> -----Original Message-----
> From: Xuefu Zhang [mailto:xzhang@cloudera.com]
> Sent: Monday, March 24, 2014 3:21 PM
> To: dev@hive.apache.org
> Subject: Re: hive partition questions
>
> As far as I know, select * from table gives you all data across all
> partitions, and I don't think there is a config option to ask Hive to read
> "latest" partition.
>
> --Xuefu
>
>
> On Mon, Mar 24, 2014 at 12:34 PM, Darapaneni, Hazarath
> <hdarapaneni@ea.com>wrote:
>
> > Hi Team,
> >
> >
> > I have a scenario that I need help from you guys, please check and let
> > me know, if it's feasible or not.
> >
> > Scenario:
> >
> > I have a table called page_view and it has 10 partitions with date
> > (2013-12-20 to 2013-12-30) and I need to select latest partition
> > without giving date as where condition.
> >
> > If I do  select * from page_view then it should got to latest
> > partition as default (in this case its 2013-12-30) , is there a way to
> > do this in hive configuration.
> >
> > Thanks,
> > Hazarath.
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message