Oracle INSTR vs Hive INSTR

128 Views Asked by At

I have Oracle-query and need to use the same in Hive.

select INSTR('some string', 's', 1, 1) - INSTR('some string', 's', 1, 2);
>> -5

but Hive doesn't have INSTR like Oracle. I can use only this one:

select INSTR('some string', 's');
>> 1

and it finds first substring position in string but I need find the second or third and etc. Oracle query has specific logic thats why I can't change it.

What can I do with it?

1

There are 1 best solutions below

0
On

This was added as part of https://issues.apache.org/jira/browse/HIVE-25230 in Hive 4 alpha 2