Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Gist Page : example-python-read-and-write-from-impala-with-security

Common part

Thrift-sasl

The script bellow don't work with thrift-sasl 0.3.0 but only with thrift-sasl 0.2.1.

Add thrift-sasl==0.2.1 to your requirement.txt file.

Libraries dependency

Code Block
languagepy
import ibis
import pandas as pd
import os

...

Code Block
languagepy
# Connecting to Impala by providing Impala host ip and port (21050 by default),credentials and a Webhdfs client
hdfs = ibis.hdfs_connect(host=os.environ['IP_HDFS'], port=50070)
client = ibis.impala.connect(host=os.environ['IP_IMPALA'], port=21050, hdfs_client=hdfs, user=os.environ['LDAP_USER'], password=os.environ['LDAP_PASSWORD'], auth_mechanism='PLAIN')


Info
titleImpala over SSL

If your Impala is secured with SSL, you have to add the following parameters to your ibis.impala.connect() command:

  • use_ssl=True    → Mandatory. The client will communicate over SSL to the server.
  • ca_cert=None    → Optional. If not set, the certificate won't be validated so this may be a potential security issue. The certificate chain file is available on Saagie's servers at /data/ssl/certs/ca-chain.cert.pem

How to write an Impala table with Python ?

...