<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: how to split name based on special character in hive in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-to-split-name-based-on-special-character-in-hive/m-p/242005#M203808</link>
    <description>&lt;P&gt;You can use below sql to convert the content as required&lt;/P&gt;&lt;PRE&gt;0: jdbc:hive2://localhost&amp;gt; select * from temptable;
+---------------------+--+
| temptable.fullname  |
+---------------------+--+
| abc xxx! def ghi    |
| abc systems!        |
+---------------------+--+
0: jdbc:hive2://localhost&amp;gt; select a[0] as LAST, substr(a[1], 0, length(a[1])-1) as TITLE, a[2] as FIRST, a[3] as MID from (
0: jdbc:hive2://localhost&amp;gt; select case
0: jdbc:hive2://localhost&amp;gt; when instr(fullname, "!" )=length(fullname) then array('', '!', substr(fullname, 0, length(fullname)-1), '')
0: jdbc:hive2://localhost&amp;gt; else split(fullname, " ") end as a from temptable) t;
+-------+--------+--------------+------+--+
| last  | title  |    first     | mid  |
+-------+--------+--------------+------+--+
| abc   | xxx    | def          | ghi  |
|       |        | abc systems  |      |
+-------+--------+--------------+------+--+&lt;/PRE&gt;&lt;P&gt;If my answer helped to resolve the issue, please accept. It might help others in the community.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jan 2019 23:55:37 GMT</pubDate>
    <dc:creator>nramanaiah</dc:creator>
    <dc:date>2019-01-11T23:55:37Z</dc:date>
  </channel>
</rss>

