-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set http header with thrift version 0.15.0 #417
Comments
We also found this using using PyHive To replicate the issue you can create a hive session using a HTTP transport with the custom header that HiveServer2 requires for authorization: from pyhive import hive
import base64
import thrift.transport.THttpClient
def thrift_http_transport():
transport = thrift.transport.THttpClient.THttpClient(uri_or_host='http://localhost:12001/cliservice')
auth_credentials = '{}:{}'.format('-', '-').encode('UTF-8')
auth_credentials_base64 = base64.standard_b64encode(auth_credentials).decode('UTF-8')
transport.setCustomHeaders(
{
'Authorization': 'Basic {}'.format(auth_credentials_base64), # HiveServer2 BASIC auth
}
)
return transport
conn = hive.connect(thrift_transport=thrift_http_transport())
cursor = conn.cursor()
cursor.execute("""SELECT SUM(1) from model.dim_date""")
data = cursor.fetchall()
cursor.close()
conn.close()
print(data) With thrift
This appears to be related to changes made for https://issues.apache.org/jira/browse/THRIFT-5165 Related PR: apache/thrift#2086 |
There is an open issue on Jira which is related to this problem. |
No description provided.
The text was updated successfully, but these errors were encountered: