MCPcopy Create free account
hub / github.com/apache/impala / get_hs2_hive_cursor

Function get_hs2_hive_cursor

tests/performance/query_exec_functions.py:37–53  ·  view source on GitHub ↗
(hiveserver, user=None, use_kerberos=False,
                        database=None, execOptions=None)

Source from the content-addressed store, hash-verified

35
36
37def get_hs2_hive_cursor(hiveserver, user=None, use_kerberos=False,
38 database=None, execOptions=None):
39 host, port = hiveserver, DEFAULT_HIVE_HS2_PORT
40 cursor = None
41 try:
42 conn = connect(host=host,
43 port=DEFAULT_HIVE_HS2_PORT,
44 user=user,
45 database=database,
46 auth_mechanism="GSSAPI" if use_kerberos else "PLAIN",
47 timeout=maxsize)
48
49 cursor = conn.cursor(configuration=execOptions)
50 LOG.info("Connected to {0}:{1}".format(host, port))
51 except Exception as e:
52 LOG.error("Error Connecting: {0}".format(str(e)))
53 return cursor
54
55
56def execute_using_hive_hs2(query, query_config):

Callers 1

execute_using_hive_hs2Function · 0.85

Calls 3

cursorMethod · 0.45
formatMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected