{"id":23199,"library":"acryl-pyhive","title":"Acryl PyHive","description":"A Python interface to Hive (and SparkSQL) via Thrift/HiveServer2. Fork of the original PyHive maintained by Acryl Data. Current version: 0.6.18. Release cadence is irregular; latest releases focus on bug fixes and compatibility.","status":"active","version":"0.6.18","language":"python","source_language":"en","source_url":"https://github.com/acryldata/PyHive","tags":["hive","sparksql","thrift","hiveserver2","database"],"install":[{"cmd":"pip install acryl-pyhive","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for Hive thrift connection.","package":"thrift","optional":false},{"reason":"Required for SASL authentication, especially on Python 3.11+.","package":"pure-sasl","optional":false},{"reason":"Provides hive dependency extras.","package":"pyhive[hive]","optional":true}],"imports":[{"note":"Note: even though the package is 'acryl-pyhive', the import remains 'pyhive'.","symbol":"hive","correct":"from pyhive import hive"},{"note":"Similarly, sparksql is also under 'pyhive'.","symbol":"sparksql","correct":"from pyhive import sparksql"},{"note":"The correct class name is HiveConnection, not Connection. Wrong import leads to AttributeError.","wrong":"from pyhive.hive import Connection","symbol":"HiveConnection"}],"quickstart":{"code":"from pyhive import hive\nconn = hive.HiveConnection(\n    host='your-hive-server',\n    port=10000,\n    username='your-username',\n    auth='NONE'\n)\ncursor = conn.cursor()\ncursor.execute('SELECT 1')\nprint(cursor.fetchone())\ncursor.close()\nconn.close()","lang":"python","description":"Connects to Hive and runs a simple query."},"warnings":[{"fix":"Ensure headers are properly set before HTTP calls; do not assume they persist across requests.","message":"In v0.6.15, the HTTP transport's handling of thrift headers changed; old code relying on mutable headers may break.","severity":"breaking","affected_versions":"<0.6.15"},{"fix":"Install pure-sasl if you get import errors related to sasl.","message":"Python 3.11+ may have issues with sasl library – the dependency now uses pure-sasl as a fallback.","severity":"gotcha","affected_versions":">=0.6.14"},{"fix":"Use 'USE database_name' or specify schema in your queries.","message":"The 'database' parameter in HiveConnection is deprecated in favor of specifying schema in SQL.","severity":"deprecated","affected_versions":"all?"},{"fix":"Set auth parameter explicitly: 'NONE', 'LDAP', 'KERBEROS', or 'CUSTOM'.","message":"Default auth mechanism may differ from HiveServer2 expectations; using auth='NONE' works for unsecured clusters, but LDAP or KERBEROS require extra setup.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from pyhive import hive'.","cause":"Using 'import pyhive' instead of 'from pyhive import hive'.","error":"AttributeError: module 'pyhive' has no attribute 'hive'"},{"fix":"Install pure-sasl: pip install pure-sasl","cause":"The sasl library is not installed and the system fails to compile it on Python 3.11+.","error":"ModuleNotFoundError: No module named 'sasl'"},{"fix":"Specify the correct auth parameter: 'NONE' for unsecured clusters.","cause":"Using an unsupported or mismatched auth mechanism.","error":"thrift.Thrift.TException: Invalid authentication method"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}