0

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?

Yurka
  • 21
  • 5
  • This is working in Hive 4 alpha 2. You may be using older hive version `select INSTR('some string', 's', 1, 1) - INSTR('some string', 's', 1, 2);` – Raid Jan 04 '23 at 16:13

1 Answers1

0

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

Raid
  • 188
  • 1
  • 10