Skip to content
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

fix(databricks): update databricks ODBC connector #1344

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions toucan_connectors/databricks/databricks_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,15 @@ class DatabricksConnector(ToucanConnector):
http_path: str = Field(
..., description='Databricks compute resources URL', placeholder='sql/protocolv1/o/xxx/yyy'
)
user: str | None = Field(
'token',
description='"token" if you use a personal access token, or username if you connect by username/password',
placeholder='token',
)
pwd: SecretStr = Field(
None, description='Your personal access token', placeholder='dapixxxxxxxxxxx'
...,
description='Your personal access token, or password if you connect by username/password',
placeholder='dapixxxxxxxxxxx',
)
ansi: bool = False
on_demand: bool = Field(
Expand All @@ -53,7 +60,7 @@ def _build_connection_string(self) -> str:
'ThriftTransport': 2,
'SSL': 1,
'AuthMech': 3,
'UID': 'token',
'UID': self.user if self.user is not None else 'token',
'PWD': self.pwd.get_secret_value(),
}
return ';'.join(f'{k}={v}' for k, v in connection_params.items() if v is not None)
Expand Down
7 changes: 3 additions & 4 deletions toucan_connectors/install_scripts/databricks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ fi
apt-get update
apt-get install -fyq libsasl2-modules-gssapi-mit wget unzip
mkdir -p /tmp/databricks
# The next link was extracted from an email received after
# filling: https://databricks.com/spark/odbc-driver-download
wget 'https://public-package.toucantoco.com/connectors_sources/databricks/SimbaSparkODBC-2.6.4.1004-Debian-64bit.zip' \
# This package was downloaded from https://www.databricks.com/spark/odbc-drivers-download
wget 'https://public-package.toucantoco.com/connectors_sources/databricks/SimbaSparkODBC-2.7.5.1012-Debian-64bit.zip' \
-O /tmp/databricks/simbaspark.zip
unzip /tmp/databricks/simbaspark.zip -d /tmp/databricks
dpkg -i /tmp/databricks/SimbaSparkODBC-2.6.4.1004-Debian-64bit/simbaspark_2.6.4.1004-2_amd64.deb
dpkg -i /tmp/databricks/simbaspark_2.7.5.1012-2_amd64.deb
rm -rf /tmp/databricks
touch ~/databricks-installed