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

Function run_query

tests/util/run_impyla_http_query.py:31–45  ·  view source on GitHub ↗

Runs a query using Impyla. Args must contain various options that are forwarded to Impyla's connect() method.

(query, args)

Source from the content-addressed store, hash-verified

29
30
31def run_query(query, args):
32 """Runs a query using Impyla. Args must contain various options that are forwarded to
33 Impyla's connect() method."""
34 auth_mechanism = 'NOSASL'
35 if args.user:
36 auth_mechanism = 'LDAP'
37 conn = impyla.connect(host=args.host, port=args.port, user=args.user,
38 password=args.password, auth_mechanism=auth_mechanism,
39 use_http_transport=True, http_path=args.http_path,
40 http_cookie_names=args.http_cookie_names)
41 cursor = conn.cursor()
42 cursor.execute(query)
43 result = cursor.fetchall()
44 # Print the result so that the caller can validate it.
45 print(str(result))
46
47
48def main():

Callers 1

mainFunction · 0.85

Calls 3

connectMethod · 0.45
cursorMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected