Skip to content

Commit

Permalink
fix(impala): allow arbitrary connection params
Browse files Browse the repository at this point in the history
  • Loading branch information
A developer authored and cpcloud committed Sep 9, 2023
1 parent a0095bf commit f251289
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
20 changes: 20 additions & 0 deletions docs/backends/impala.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,26 @@ hdfs = ibis.impala.hdfs_connect(host=webhdfs_host, port=webhdfs_port)
client = ibis.impala.connect(host=impala_host, port=impala_port, hdfs_client=hdfs)
```

By default binary transport mode is used, however it is also possible to use HTTP.
Depending on your configuration, additional connection arguments may need to be provided.
For the full list of possible connection arguments please refer to
the [`impyla`](https://github.com/cloudera/impyla) documentation.

```python
import ibis

client = ibis.impala.connect(
host=impala_host,
port=impala_port,
username=username,
password=password,
use_ssl=True,
auth_mechanism='LDAP',
use_http_transport=True,
http_path='cliservice',
)
```

All examples here use the following block of code to connect to impala
using docker:

Expand Down
6 changes: 5 additions & 1 deletion ibis/backends/impala/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def do_connect(
kerberos_service_name: str = "impala",
pool_size: int = 8,
hdfs_client: fsspec.spec.AbstractFileSystem | None = None,
**params: Any,
):
"""Create an Impala `Backend` for use with Ibis.
Expand Down Expand Up @@ -262,6 +263,10 @@ def do_connect(
Size of the connection pool. Typically this is not necessary to configure.
hdfs_client
An existing HDFS client.
params
Any additional parameters necessary to open a connection to Impala.
Please refer to impyla documentation for the full list of
possible arguments.
Examples
--------
Expand All @@ -283,7 +288,6 @@ def do_connect(
self._temp_objects = set()
self._hdfs = hdfs_client

params = {}
if ca_cert is not None:
params["ca_cert"] = str(ca_cert)
self.con = ImpalaConnection(
Expand Down

0 comments on commit f251289

Please sign in to comment.