Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Hive help on the update


Copy link to this message
-
Hive help on the update
Hi Hive Team,

I have Teradata Query as below and my intention is to convert in to Hive Query(HQL). Tried but it's vain.

SELECT Col_1, Col_2, Col_3,  MIN(Col_3) OVER(Partition by Col_1 ORDER BY Col_3, Col_2 rows between 1 preceding and 1 preceding) prev_Col_3 FROM work_table ;

Example:

Actual Work table:
Col_1

Col_3

Prev_Col_3

P1

9:00

Null

P1

10:00

Null

P2

11:00

Null

P2

12:00

Null
Expected result:
Col_1

Col_3

Prev_Col_3

P1

9:00

Null

P1

10:00

9:00

P2

11:00

Null

P2

12:00

11:00
Any help will be much help full.

Regards, Kumar Chinnakali :)

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are not
to copy, disclose, or distribute this e-mail or its contents to any other person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
every reasonable precaution to minimize this risk, but is not liable for any damage
you may sustain as a result of any virus in this e-mail. You should carry out your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***