How to output array in hive python UDF
<p>I used python to do UDF in hive. Is there some method to output array/map such structured data from UDF?
I am tried to return a python list in UDF, but it can't be convert to a hive array.</p>

<p>When you are trying to return a python list in UDF, I suggest that you split the list and process each data step by step.
Here is an example.Use 'TRANSFORM' in hive wisely.</p>

<pre><code>#!/usr/bin/env python
#-*- coding:utf-8 -*-
# demo.py
import sys
import datetime
import time

#Turn the timestamp into string 
def timestamp_toString(stamp):
    return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(stamp))

for line in sys.stdin:
    print timestamp_toString(float(line))
</code></pre>

<p>in hive console  </p>

<pre><code>hive&gt; add file /ebs/hive/test/demo.py;
select TRANSFORM(time) using 'python demo.py' as (time) from (select * from access_fccs where week=41 limit 10) a ;
</code></pre>

python hive udf