hive like 模糊匹配
生活随笔
收集整理的這篇文章主要介紹了
hive like 模糊匹配
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
類似:
在MYSQL里面我們可以這樣的執行SQLselect a.Community,a.PID,b.spidertime,b.comm,b.showings,b.room from lianjia_list a ,RentHouse_lianjia b where a.site = 7 and b.city='北京' and b.comm like %a.Community%;不行我們可以這樣
select a.Community,a.PID,b.spidertime,b.comm,b.showings,b.room from lianjia_list a ,RentHouse_lianjia b where a.site = 7 and b.city='北京' and b.comm like {%a.Community%};或者類似其他的我們可以直接%你要匹配的字段% 但是在hive里面不行,有人說這事一個BUG,并自定義UDF去完成這個操作,因為他轉義了!今天我試了很多種方法,讓我頭疼了也很久select a.Community,a.PID,b.spidertime,b.comm,b.showings,b.room from lianjia_list a ,RentHouse_lianjia b where a.site = 7 and b.city='北京' and b.comm like concat('%',a.Community,'%');發現,我們這樣用拼接字符串的方式來實現模糊匹配,大家試試吧!
?
轉載于:https://www.cnblogs.com/tnsay/p/5752616.html
總結
以上是生活随笔為你收集整理的hive like 模糊匹配的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: css浮动+应用(瀑布流效果的实现)
- 下一篇: 爬取网易新闻