Convert Numeric value to Binary value in hive

2019-09-09 20:22发布

问题:

I want to get a numeric value immediately after a particular word in string In hive
example : APDSGDSCRAM051 in that I need to get numeric value after word RAM is it possible in hive after that I need to convert the resulted value to binary

is it possible in hive ?

Note: its not a fixed length string

回答1:

'create table string_testing (c string);
insert into table string_testing values ('APDSGDSCRAM051');
select substr(c, instr(c, 'RAM') + 3) from string_testing;
OK
051`


标签: hive