Re: Use RANK OVER PARTITION function in Hive 0.11

2013-07-19 Thread Edward Capriolo
Please send the fnal working queries. On Friday, July 19, 2013, Jérôme Verdier verdier.jerom...@gmail.com wrote: Hi, The error is resolved. I have 3 RANK() function in my script. 2 are working with arguments, but one is working without arguments. I don't understand it, but the fact is

Re: Use RANK OVER PARTITION function in Hive 0.11

2013-07-19 Thread Jérôme Verdier
Below you can find the 3 working queries from my script : rank() over (partition by sg.co_societe,sg.id_produit order by sg.date_maj desc,sg.co_type_ref) as rang RANK(pnvente.dt_debut_commercial, COALESCE(pnvente.id_produit,dem.id_produit)) OVER (PARTITION BY mag.co_magasin, dem.id_produit ORDER

Re: Use RANK OVER PARTITION function in Hive 0.11

2013-07-17 Thread Richa Sharma
Jerome I would recommend that you try Rank function with columns from just one table first. Once it is established that rank is working fine then add all the joins. I am still on Hive 0.10 so cannot test it myself. However, I can find a similar issue on following link - so its possible you are

Re: Use RANK OVER PARTITION function in Hive 0.11

2013-07-17 Thread Vijay
As the error message states: One ore more arguments are expected, you have to pass a column to the rank function. On Wed, Jul 17, 2013 at 1:12 AM, Jérôme Verdier verdier.jerom...@gmail.comwrote: Hi Richa, I have tried a simple query without joins, etc SELECT RANK() OVER (PARTITION BY

Re: Use RANK OVER PARTITION function in Hive 0.11

2013-07-17 Thread Jérôme Verdier
Hi Vijay, Could you give me an example, i'm not sure of what you're meaning. Thanks, 2013/7/17 Vijay tec...@gmail.com As the error message states: One ore more arguments are expected, you have to pass a column to the rank function. On Wed, Jul 17, 2013 at 1:12 AM, Jérôme Verdier

Re: Use RANK OVER PARTITION function in Hive 0.11

2013-07-17 Thread Richa Sharma
Vijay Jerome has already passed column - mag.co_societe for rank. syntax - RANK() OVER (PARTITION BY mag.co_societe ORDER BY mag.me_vente_ht) This will generate a rank for column mag.co_societe based on column value me_vente_ht Jerome, Its possible you are also hitting the same bug as I

Re: Use RANK OVER PARTITION function in Hive 0.11

2013-07-17 Thread Jérôme Verdier
Hi Richa, I have tried one query, with what i've understand of Vijay's tips. SELECT code_entite, RANK(mag.me_vente_ht) OVER (PARTITION BY mag.co_societe ORDER BY mag.me_vente_ht) AS rank FROM default.thm_renta_rgrp_produits_n_1 mag; This query is working, it gives me results. You say that

Use RANK OVER PARTITION function in Hive 0.11

2013-07-16 Thread Jérôme Verdier
Hi, I have a problem while using RANK OVER PARTITION function with Hive. Hive is in version 0.11 and, as we can see here : https://cwiki.apache.org/Hive/languagemanual-windowingandanalytics.html, we can now use these functions in Hive. But, when i use it, i encountered this error : FAILED:

Re: Use RANK OVER PARTITION function in Hive 0.11

2013-07-16 Thread Richa Sharma
Hi Jerome I think the problem is you are trying to use MIN, SUM and RANK function in a single query. Try to get the rank first in a query and on top of it apply these aggregate functions Richa On Tue, Jul 16, 2013 at 2:15 PM, Jérôme Verdier verdier.jerom...@gmail.comwrote: Hi, I have a

Re: Use RANK OVER PARTITION function in Hive 0.11

2013-07-16 Thread Jérôme Verdier
Hi Richa, I tried to execute the rank function alone, but the result is the same Thanks 2013/7/16 Richa Sharma mailtorichasha...@gmail.com Hi Jerome I think the problem is you are trying to use MIN, SUM and RANK function in a single query. Try to get the rank first in a query and on

Re: Use RANK OVER PARTITION function in Hive 0.11

2013-07-16 Thread Richa Sharma
Can you share query with just RANK(). Richa On Tue, Jul 16, 2013 at 6:08 PM, Jérôme Verdier verdier.jerom...@gmail.comwrote: Hi Richa, I tried to execute the rank function alone, but the result is the same Thanks 2013/7/16 Richa Sharma mailtorichasha...@gmail.com Hi Jerome I think

Re: Use RANK OVER PARTITION function in Hive 0.11

2013-07-16 Thread Jérôme Verdier
You can see my query below : SELECT mag.co_magasin, dem.id_produit as id_produit_orig, pnvente.dt_debut_commercial as dt_debut_commercial, COALESCE(pnvente.id_produit,dem.id_produit) as