hive like vs rlike vs regexp

like vs rlike vs regexp

rlike == regexp,底层实现一样,使用正则 
like 有一些优化,对于查询类型分为五种类型:

NONE, // "abc"
BEGIN, // "abc%"
END, // "%abc"
MIDDLE, // "%abc%"
COMPLEX, // all other cases, such as "ab%c_de"

NONE、BEGIN和END三种使用字符串查找,不使用正则,COMPLEX使用正则,MIDDLE分两种:(1)%abc% 使用字符串查找(2)%ab_c%使用正则。

猜你喜欢

转载自bupt04406.iteye.com/blog/1845963
VS