Acryl PyHive
raw JSON → 0.6.18 verified Fri May 01 auth: no python
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.
pip install acryl-pyhive Common errors
error AttributeError: module 'pyhive' has no attribute 'hive' ↓
cause Using 'import pyhive' instead of 'from pyhive import hive'.
fix
Use 'from pyhive import hive'.
error ModuleNotFoundError: No module named 'sasl' ↓
cause The sasl library is not installed and the system fails to compile it on Python 3.11+.
fix
Install pure-sasl: pip install pure-sasl
error thrift.Thrift.TException: Invalid authentication method ↓
cause Using an unsupported or mismatched auth mechanism.
fix
Specify the correct auth parameter: 'NONE' for unsecured clusters.
Warnings
breaking In v0.6.15, the HTTP transport's handling of thrift headers changed; old code relying on mutable headers may break. ↓
fix Ensure headers are properly set before HTTP calls; do not assume they persist across requests.
gotcha Python 3.11+ may have issues with sasl library – the dependency now uses pure-sasl as a fallback. ↓
fix Install pure-sasl if you get import errors related to sasl.
deprecated The 'database' parameter in HiveConnection is deprecated in favor of specifying schema in SQL. ↓
fix Use 'USE database_name' or specify schema in your queries.
gotcha Default auth mechanism may differ from HiveServer2 expectations; using auth='NONE' works for unsecured clusters, but LDAP or KERBEROS require extra setup. ↓
fix Set auth parameter explicitly: 'NONE', 'LDAP', 'KERBEROS', or 'CUSTOM'.
Imports
- hive
from pyhive import hive - sparksql
from pyhive import sparksql - HiveConnection wrong
from pyhive.hive import ConnectioncorrectInternal server error