title: Hive check elements in array and get index
body: <p>I have a hive table (students) which has two columns that are arrays.</p>
  <pre><code>student_list                array&lt;string&gt;                               
  present_list                array&lt;string&gt; 
  </code></pre>
  <p>I know there is a hive function <code>array_contains(Array&lt;T&gt;, value)</code> to check if the item is present in the array but what I want to know is the index the item is present in for multiple items.</p>
  <p>Example data of student_list is some student id like</p>
  <pre><code>[&quot;1LPT5Q4IE5XC&quot;,&quot;1SU2QNCG98BC&quot;,&quot;29V3SAK2Q79Z&quot;]
  </code></pre>
  <p>If present_list is</p>
  <pre><code>[&quot;1LPT5Q4IE5XC&quot;,&quot;29V3SAK2Q79Z&quot;]
  </code></pre>
  <p>I want the output as <code>[0,2]</code> for that row.</p>