Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Hive query for functions

avatar
Explorer

I'm a newbie, I want to calculate month on month percentage change in price change in my table. Im using hive and using query:

 

select year(stock_date),month(stock_date),sum(stock_price) over (partition by year(stock_date),month(stock_date) ORDER BY month(stock_date)), PERCENT_RANK() OVER(ORDER BY month(stock_date) DESC) AS per from table4;

 

it's generating, It's showing July 2019 at the top and goes descending thru the numbers. how do I get the months in correct order and the percentage change with it?

 

mystefied__0-1648012945794.png

can anyone help me understand what am I doing wrong?

 

12 REPLIES 12

avatar
Explorer

Im using a VM that is running this version. I'll try if I can update it. In case I can then I;ll try your queries again. 

 

Thanks a lot for trying to help. 

avatar
Explorer

Hello Andre,

 

Can you share the steps to upgrade the CDH / Hive to version 2 or 3 so at least the above commands can execute.


Also advise if I can download CDH 7 or 6 VM from Cloudera website, I do not have an active subscription but need trial for few days.

 

Thanks a lot for your help.

avatar
Super Guru

@mystefied_ ,

 

You can download the CDP Trial version from the Cloudera website below:

 

https://www.cloudera.com/downloads/cdp-private-cloud-trial/cdp-private-cloud-base-trial.html

 

Cheers,

André

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.