Does Hive have a String split function?

前端 未结 3 958
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 05:48

I am looking for a in-built String split function in Hive? e.g. if String is:

A|B|C|D|E

Then I want to have a function like:



        
3条回答
  •  星月不相逢
    2020-12-13 06:31

    Another interesting usecase for split in Hive is when, for example, a column ipname in the table has a value "abc11.def.ghft.com" and you want to pull "abc11" out:

    SELECT split(ipname,'[\.]')[0] FROM tablename;
    

提交回复
热议问题