是否可以将请求超时设置为 Impala?使用 Python 和 impyla 驱动程序
问问题
1275 次
1 回答
1
根据代码https://github.com/cloudera/impyla,看起来只有 connect 方法支持超时。
% grep timeout * -R
impala/dbapi.py:def connect(host='localhost', port=21050, database=None, timeout=None,
impala/dbapi.py: timeout : int, optional
impala/dbapi.py: Connection timeout in seconds. Default is no timeout.
impala/dbapi.py: timeout=timeout, use_ssl=use_ssl,
impala/hiveserver2.py:def connect(host, port, timeout=None, use_ssl=False, ca_cert=None,
impala/hiveserver2.py: if timeout is not None:
impala/hiveserver2.py: timeout = timeout * 1000. # TSocket expects millis
impala/hiveserver2.py: sock.setTimeout(timeout)
impala/hiveserver2.py: # thriftpy has a release where set_timeout is missing
impala/hiveserver2.py: sock.set_timeout(timeout)
impala/hiveserver2.py: sock.socket_timeout = timeout
impala/hiveserver2.py: sock.connect_timeout = timeout
impala/tests/test_dbapi_connect.py: self.connection = connect(ENV.host, ENV.port, timeout=5)
impala/tests/test_dbapi_connect.py: timeout=5,
impala/tests/test_dbapi_connect.py: timeout=5,
impala/tests/test_dbapi_connect.py: self.connection = connect(ENV.host, ENV.hive_port, timeout=5)
impala/thrift/ImpalaService.thrift: // --idle_query_timeout if that flag > 0.
于 2018-04-06T22:51:29.153 回答