Quantcast
Channel: Hortonworks » All Replies
Viewing all articles
Browse latest Browse all 3435

Reply To: Hive UDF function request problem

$
0
0

Thanks Thejas.
I used the LAG function to compare the current value to previous one like this

select t.date, t.state from (select date, HA300BL_P, statechanged(LAG(state, 1) over (PARTITION BY weekofyear(date) ORDER BY date) as state_ from demo_bd where state is not null) t where t.state is not null;

This works fine.
However the performance are very very poor, I guess due to Lag function. So I don’t know if there is any way to optimize this type of query.
Thanks again.


Viewing all articles
Browse latest Browse all 3435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>