蜂巢式查询:根据其他列值与某些特定值匹配的条件选择一个列,然后将匹配结
技术问答
274 人阅读
|
0 人回复
|
2023-09-12
|
我必须在HiveQL进行一些查询和创建列操作。2 [% J/ a9 u# k
例如,
_: C# Z/ W0 {( D* ?0 U( Yapp col1app1 anybody love me?app2 I hate uapp3 this hat is goodapp4 I don't like this oneapp5 oh my godapp6 damn you.app7 such nice girlapp8 xxxxxapp9 pretty prefectapp10 don't love me.app11 xxx anybody?[''anybody','love','you','xxx','don't并选择匹配的关键字结果作为新列,命名keyword如下:" z* l* p2 b' O& U* B% y5 C/ L% x+ ~# f& e. w
app keywordapp1 anybody,loveapp4 I don't like this oneapp6 damn you.app8 xxxapp10 don't,loveapp11 xxx看来我必须使用嵌套查询。
; w1 f% `4 R# J; t" n逻辑有点像选择匹配结果并设置匹配结果,应该保存在列表中或类似的新列中。
: e6 O. v z0 d+ t# f" k但是我对HiveQL不够熟悉。' h( a4 U/ ?% k" Z% ^
有人能帮我吗?
7 L: [# Q7 d3 \0 b: N先感谢) L' @+ Z8 I/ ~: j3 v. `
# \. k# X) n( z
解决方案: |
|
|
|
|
|