Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Repeat values with in the GROUP in HIVE

Highlighted

Repeat values with in the GROUP in HIVE

New Contributor

I am trying to repeat a row value in the subsequent rows with in GROUP. A Group can have one or more TAG. The requirement is to populate NEW_TAG in the row where the TAG is populated and in the subsequent rows until another TAG populated with in the same group or we reach end of that GROUP.

 

Current Table      Required Table

GROUPID SEQ TAG    GROUPID SEQ TAG NEW_TAG
------- --- ----   ------- --- --- --------
1       1           1       1       
1       2           1       2       
1       3           1       3       
1       4   4       1       4   4   4
1       5           1       5       4
1       6           1       6       4
1       7           1       7       4
1       8           1       8       4
2       1           2       1       
2       2           2       2       
2       3           2       3       
2       4           2       4       
2       5   5       2       5   5   5
2       6           2       6       5
2       7           2       7       5
2       8           2       8       5
2       9   9       2       9   9   9
2      10           2      10       9
2      11           2      11       9

 

Thanks in Advance

Don't have an account?
Coming from Hortonworks? Activate your account here