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

Switch to Plain View
Hive >> mail # user >> Combine multiple row values based upon a condition.

Copy link to this message
Combine multiple row values based upon a condition.
Hi all,

I new to Apache Hive and I am doing some test to see if it fits my needs, one of the questions I have if it is possible to "peek" for the next row in order to find out if the values should be combined. Let me explain by an example.

Let say my data looks like this

Id name offset
1 Jan 100
2 Janssen 104
3 Klaas 150
4 Jan 160
5 Janssen 164

An my output to another table should be this

Id fullname offsets
1 Jan Janssen [ 100, 160 ]

I would like to combine the name values from two rows where the offset of the two rows are no more then 1 character apart.

Is this type of data manipulation is possible and if it is could someone point me to the right direction hopefully with some explaination?

Kind regards
Dean Wampler 2013-02-03, 14:07
John Omernik 2013-02-03, 12:05
Martijn van Leeuwen 2013-02-03, 18:59
John Omernik 2013-02-03, 19:07
Martijn van Leeuwen 2013-02-03, 19:27
Edward Capriolo 2013-02-03, 19:36
John Omernik 2013-02-03, 22:54
Martijn van Leeuwen 2013-02-04, 07:47