1.pandas中的dataframe
1.工作原因,需要从hive读取数据到pandas中进行操作,然后处理完全以后需要再读取到es中。
读取hive数据:因为脚本在生产上,所以,导入的包如果有缺失,可以自己补一下。
import pandas as pd
from pyhive import hive
import json
import time
from elasticsearch import Elasticsearch
2.读取Hive数据库
conn=hive.connect(host='',port='',username='',database='')
sql='select * from table1'
start_time=time.time(