presto.authentication.type=PASSWORD presto.authentication.passthrough-user=true(如果您使用的是 LDAP、Kerberos 或其他认证方式,请将其设置为 false)
from pyhive import hive from TCLIService.ttypes import TOperationState
def wait_query(connection, cursor): while True: state = cursor.poll().operationState if state in (TOperationState.ERROR_STATE, TOperationState.CLOSED_STATE): raise Exception("Query terminated with state {}".format(state)) if state == TOperationState.FINISHED_STATE: return connection.commit()
SQLALCHEMY_DATABASE_URI = 'presto://
SQLLAB_TIMEOUT = 600 SUPERSET_WEBSERVER_TIMEOUT = 600
SQLALCHEMY_POOL_NAME = "superset-legacy"
SQLALCHEMY_ENGINE_OPTIONS = { "pool_size": 20, "pool_recycle": 300, "pool_pre_ping": True, "pool_use_lifo": True, "max_overflow": 10, "execution_options": {"isolation_level": "READ UNCOMMITTED"}, }
ADDITIONAL_MIDDLEWARE = ["superset.utils.sasl_authentication_middleware"]
注意:以上代码示例中的