I have a code, which is working on ORACLE, I was looking to migrate the same in Hive. Recently I realized that in Hive, INSTR function takes only TWO arguments. So that's an issue for me. Not able to figure out the way around, Kindly help!
Code in Oracle
INSTR(Substr(CLOB_Col, (INSTR ( Clob_col, '[' || Col2 || '') +
( INSTR ( substr ( Clob_col, '[' || Col2 || '')) , CHAR(93)+1))),
substr(substr((CLOB_col,(INSTR(Clob_col, '[' || Col2 || '')+
(INSTR(SUBSTR(CLOB_col, INSTR(Clob_col, '[' || Col2 || '')),CHAR(93)+1))),-2)-1,1)
+1 AS POSITION_OF_CHAR
Code in HIVE
INSTR(Substr(CLOB_Col, (INSTR ( Clob_col,CONCAT('[',Col2,'')) +
( INSTR ( substr ( Clob_col,CONCAT('[',Col2,'')),93)+1))),
substr(substr((CLOB_col,(INSTR(Clob_col, CONCAT('[',Col2,''))+
(INSTR(SUBSTR(CLOB_col, INSTR(Clob_col, CONCAT('[',Col2,''))),93 )+1))),-2)-1,1)
+1 AS POSITION_OF_CHAR
Any input will be appreciated.