You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Rex X <dn...@gmail.com> on 2016/09/26 06:29:27 UTC

odd behavior of ntile

Hi All,

I run following hive

create table2 as
select
id,
ntile(6) over (partition by city order by price) as price_tile,
ntile(3) over (partition by city order by discount) as discount_tile,
ntile(6) over (partition by city order by number) as number_tile
from table1;


Table1 contains 8 million records with unique id, table2 contains the same
number of records but with 15k missing ids and 15k duplicate ids.

Is it because that we are not allowed to use multiple ntile's in one hive
query?

Re: odd behavior of ntile

Posted by Rex X <dn...@gmail.com>.
Is this a bug of hive?



On Sun, Sep 25, 2016 at 11:29 PM, Rex X <dn...@gmail.com> wrote:

> Hi All,
>
> I run following hive
>
> create table2 as
> select
> id,
> ntile(6) over (partition by city order by price) as price_tile,
> ntile(3) over (partition by city order by discount) as discount_tile,
> ntile(6) over (partition by city order by number) as number_tile
> from table1;
>
>
> Table1 contains 8 million records with unique id, table2 contains the same
> number of records but with 15k missing ids and 15k duplicate ids.
>
> Is it because that we are not allowed to use multiple ntile's in one hive
> query?
>
>
>
>
>