我有一张这样的table:
Source Target DateA B 2018-01-14B C 2018-06-29C D 2019-03-05
Source Target Date
A B 2018-01-14
B C 2018-06-29
C D 2019-03-05
我的目标是创建这样的路径:d在oracle中,我会使用connectby函数,但在hive中是否可以这样做?
ecfdbz9o1#
选择col1,col2,date,concat(x,lead(y)over())from(select*,concat(col1,col2,lead(col2)over())作为x,lead(col2)over()作为y from table)x;
1条答案
按热度按时间ecfdbz9o1#
选择col1,col2,date,concat(x,lead(y)over())from(select*,concat(col1,col2,lead(col2)over())作为x,lead(col2)over()作为y from table)x;