(<type 'exceptions.ValueError'>, ValueError('need more than 1 value to unpack',), <traceback object at 0x7f24dea1a0e0>) NULL NULL NULL
<p>I have HIVE table like this in MapR.</p>

<p><a href="https://i.stack.imgur.com/zTolR.png" rel="nofollow"><img src="https://i.stack.imgur.com/zTolR.png" alt="enter image description here"></a></p>

<p>data was separated with commas at back end. I am trying to use custom map reduce in using python. Here is the python code.</p>

<pre><code>import sys
import datetime
try:
    for line in sys.stdin:
        line = line.strip()
        userid, movieid, rating, unixtime = line.split(',')
        weekday = datetime.datetime.fromtimestamp(float(unixtime)).isoweekday()
        print ','.join([userid, movieid, rating, unixtime, str(weekday)])
except:
    print sys.exc_info()
</code></pre>

<p>I have added python script using <code>add File</code>, submitted query like this</p>

<pre><code>select TRANSFORM (userid,movieid,rating,unixtime) using 'python mod.py' as (userid,movieid,rating,weekday) from u_data;
</code></pre>

<p>Error that i am getting here is </p>

<pre><code>(&lt;type 'exceptions.ValueError'&gt;, ValueError('need more than 1 value to unpack',), &lt;traceback object at 0x7f24dea1a0e0&gt;) NULL    NULL  NULL
</code></pre>

<p>Why am i getting this error?</p>

<p>The only line in your code that could give you that error is this one:</p>

<pre><code>userid, movieid, rating, unixtime = line.split(',')
</code></pre>

<p>So it's complaining that there aren't enough values to unpack, which means there aren't any commas in the line. Try printing the line before processing it; that way you will easily be able to tell what data you are getting and how you need to process it.</p>

python hive mapr