使用python 控制连接 presto

  1. pip3 安装
pip3 install presto-python-client
  1. 连接presto 代码
conn = prestodb.dbapi.connect(host='{host}',port=8889,user='{user}',catalog='hive',schema=schema,http_scheme='http')
cur = conn.cursor()
cur.execute(sql)
rows = cur.fetchall()
posted @ 2021-03-18 00:46  运维之爪  阅读(1645)  评论(0编辑  收藏  举报