Insert row number into table
<p>I am trying to insert a row number into a table. The row_number() function works when performing a select query but the query doesn't work when I use it as part of an INSERT INTO TABLE query. I have also tried via Create Table As Select but I get the same seemingly generic error.</p>

<pre><code>FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask (state=08S01,code=2)
</code></pre>

<p>Example: This does not work.</p>

<pre><code>INSERT INTO TABLE tablea
SELECT
column1,
column2,
row_number() over (order by column2 desc)
FROM
tableb;
</code></pre>

<p>Example: This does work</p>

<pre><code>SELECT
column1,
column2,
row_number() over (order by column2 desc)
FROM
tableb;
</code></pre>

<p>Any pointers? Thanks!</p>

<p>EDIT: I'm using Hive 1.1.0 as part of CDH 5.4.8.</p>