- # -*- coding: UTF-8 -*-
- # Author: wt
- import pyhs2
- conn = pyhs2.connect(host='host_ip',
- port=10000,
- authMechanism="PLAIN",
- user='root',
- passwd='passwd')
- cur = conn.cursor()
- ops = ['like','unlike']
- file_dir = '/User/wt/....'
- for op in ops:
- local_file_path = file_dir + str(op)
- cur.execute("LOAD DATA LOCAL INPATH"+str(local_file_path)+"'INTO TABLE ai_log.ticktocks_op PARTITION(day="'+str(day)+"',ops="'+str(op)+"")")
python连接hive
猜你喜欢
转载自blog.csdn.net/weixin_41362649/article/details/81295998
今日推荐
周排行