错误 - 使用 impyla 访问 impala 数据

问题描述 投票:0回答:0

我正在尝试将 impala 与 impyla 和以下代码连接。

from impala.dbapi import connect

# Set the connection parameters
host_name = "xxx.com"
port = 21050
database = "default"
user = "xxx"
password = "xxx"

connection_url = f"jdbc:impala://{host_name}:{port}/{database}"

# Connect to Impala
conn = connect(host=host_name,
               port=port,
               database=database,
               user=user,
               password=password,
              )

conn
看起来连接成功,但是下一个代码

cursor = conn.cursor()

回来了

HiveServer2Error: Failed after retrying 3 times

如果你知道这个问题,我希望能告诉你这个错误的原因是什么以及检查conn是否真正连接成功的方法。

impala impyla
© www.soinside.com 2019 - 2024. All rights reserved.