_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › HivePython

伎 襦蠏碁 讌.
import sys
import string
from pykospacing import spacing

for line in sys.stdin:
    line = line.strip()
    pc_id, msg = line.split("\t")
    print ("\t".join([pc_id, spacing(msg)]))

hdfs k.
hadoop fs -put -f /home/hdfs/py/chat_spacing.py /user/hive/udfs

transform 襯 .
set hive.execution.engine=mr;
add file hdfs:///user/hive/udfs/chat_spacing.py;

select transform(msg) using 'python3.4 chat_spacing.py' as (pc_id bigint, msg string)
from (
    select concat(cast(id as string), "\t", sss) msg
    from sample
) t;


pyhive #

from pyhive import hive
conn = hive.Connection(host="192.168.0.100", port=10000, username="hdfs")
 
cursor = conn.cursor()
cursor.execute("SHOW TABLES")
for table in cursor.fetchall():
    print(table)

export http_proxy='http://xxx.com'
export https_proxy='https://xxx.com'

pip3.4 install pip3.4 install tensorflow --trusted-host pypi.python.org --index-url=https://pypi.python.org/simple/
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2019-01-25 10:13:54

苦 讌 . 磯Μ 蠍 企伎 朱 殊狩伎朱 螻手碓襯 螳螻 覩碁襯 螻襷 覈磯朱 蠏碁Μ螻 襯 螳讌 朱 苦 讌朱 襷. (覦覦朱れ)