title: How to use String split function on multi-delimiter strings in hive?
body: <p>My string data is like below.</p>
  
  <pre><code>data = 'ABCD/~DEFG/~HJKL/~MNOP'
  </code></pre>
  
  <p>I tried with below query </p>
  
  <pre><code>select split(data,'[/~]')[1] from test_table;
  </code></pre>
  
  <p><strong>Expected output:
  ABCD
  Original output:
  [SPACES]</strong></p>
  
  <p>When i tried the same query with index [2] its working.</p>
  
  <pre><code>select split(data,'[/~]')[2] from test_table;
  </code></pre>
  
  <p><strong>Expected output:
  DEFG
  Original output:
  DEFG</strong></p>
  
  <p>My observation:
  Its working fine for every EVEN index number like 0,2,4..
  and it is populating spaces for ODD index numbers like 1,3,5..</p>
  
  <p>Can someone help me in fixing this. </p>