Grokbase Groups Hive user August 2010
FAQ
Hi, all,

I am wondering whether INSTR will run faster than LIKE, in all cases, or
in some cases?

for example, INSTR(url, 'http://www.google.com/') = 1 VS url like '
http://www.google.com/%'
INSTR(url, 'google') = 0 VS not url like
'%google%'
INSTR(url, 'google') > 0 VS url like '%google%'


who can give some details, Thanks!



Chocobo

2010-08-10

Search Discussions

  • Zheng Shao at Aug 10, 2010 at 7:53 am
    Hive LIKE is specially optimized for prefix, suffix and instr
    operations, so it's not likely to see a difference.

    Zheng
    On Tue, Aug 10, 2010 at 12:40 AM, Neil Xu wrote:
    Hi, all,

    I am wondering whether INSTR will run faster than LIKE, in all cases, or
    in some cases?

    for example, INSTR(url, 'http://www.google.com/') = 1     VS url like
    'http://www.google.com/%'
    INSTR(url, 'google') = 0     VS not url like
    '%google%'
    INSTR(url, 'google') > 0     VS url like '%google%'


    who can give some details, Thanks!



    Chocobo

    2010-08-10


    --
    Yours,
    Zheng
    http://www.linkedin.com/in/zshao

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedAug 10, '10 at 7:41a
activeAug 10, '10 at 7:53a
posts2
users2
websitehive.apache.org

2 users in discussion

Zheng Shao: 1 post Neil Xu: 1 post

People

Translate

site design / logo © 2021 Grokbase