0

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.

Community
  • 1
  • 1
sareen
  • 19
  • 4
  • 1
    You might consider explaining what you're trying to achieve in HIVE i.e. the ORACLE version does. You're going to need help from people who are Hive experts, and they may not understand Oracle. – APC Jan 07 '20 at 13:05
  • Please provide some example of initial data and the result – leftjoin Jan 07 '20 at 15:32

0 Answers0