大数据系列之:通过trino查询hive表
大数据系列之:通过trino查询hive表
- 导入模块
- 禁用 SSL 警告
- 创建 requests_kwargs 和 requests_session
- 连接trino
- 执行查询并获取结果
- 完整代码
导入模块
from pyhive import trino
from requests import Session
from requests.auth import HTTPBasicAuth
import pandas as pd
import urllib3
pyhive.trino:
- pyhive 是一个 Python 客户端库,用于连接和操作 Trino(分布式 SQL 查询引擎)。
trino 是 pyhive 的子模块,专门用于与 Trino 服务交互。
requests.Session 和 requests.auth.HTTPBasicAuth