-
Notifications
You must be signed in to change notification settings - Fork 549
Home
Jing Wang edited this page Apr 1, 2017
·
13 revisions
This is dump of development notes.
Remove dev
from setup.cfg
's tag_build
python setup.py sdist
gpg --detach-sign --armor *.tar.gz
twine upload PyHive*
Start with http://releases.ubuntu.com/12.04/
echo Etc/UTC | sudo tee /etc/timezone
sudo dpkg-reconfigure --frontend noninteractive tzdata
sudo reboot
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install -y git oracle-java8-installer python-dev g++ libsasl2-dev openssh-server
sudo pip install virtualenv wheel
git clone https://github.com/dropbox/PyHive.git
cd PyHive
CDH=cdh5 PRESTO=0.147 scripts/travis-install.sh
virtualenv --no-site-packages ~/env
source ~/env/bin/activate
pip install -e .
pip install -r dev_requirements.txt
py.test -v
If rebooting: Rerun travis-install.sh and sudo chmod -R 777 /tmp/hive
sudo apt-get install sldap ldap-utils phpldapadmin
Edit /etc/hive/conf/hive-site.xml
<property>
<name>hive.server2.authentication</name>
<value>LDAP</value>
</property>
<property>
<name>hive.server2.authentication.ldap.url</name>
<value>ldap://localhost:389</value>
</property>
Restart HiveServer2:
sudo service hive-server2 restart
Test:
from pyhive.hive import *
from thrift.transport.TTransport import *
c = connect('localhost', username='cn=admin,dc=test,dc=com', password='a')
cur = c.cursor()
cur.execute('show tables')
print(cur.fetchall())
# should fail
try:
connect('localhost', username='cn=admin,dc=test,dc=com', password='ab')
assert False
except TTransportException as e:
assert 'Error validating the login' in e.message
print(e)