(hiveserver, user=None, use_kerberos=False,
database=None, execOptions=None)
| 35 | |
| 36 | |
| 37 | def 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 | |
| 56 | def execute_using_hive_hs2(query, query_config): |
no test coverage detected