1
0
mirror of synced 2026-01-25 10:01:49 -05:00
Files
airbyte/tools/lib/databricks.sh
LiRen Tu dfb7b8cd3f 🐞 Destination databricks: update jdbc driver to patch log4j (#7622)
* Download spark jdbc driver in build cmd

* Download jdbc driver in ci integration test

* Update comments

* Set up cloud sdk

* Add comments

* Download jdbc driver from databricks directly

* Update readme

* Use unzip command

* Install unzip for databricks

* Add databricks build status

* Close database

* Log more error information

* Close database when checking connection

* Update spec
2022-01-06 20:22:56 -08:00

25 lines
964 B
Bash

#!/usr/bin/env bash
. tools/lib/lib.sh
# Whoever runs this script must accept the following terms & conditions:
# https://databricks.com/jdbc-odbc-driver-license
_get_databricks_jdbc_driver() {
local driver_zip="SimbaSparkJDBC42-2.6.21.1039.zip"
local driver_file="SparkJDBC42.jar"
local driver_url="https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/jdbc/2.6.21/${driver_zip}"
local connector_path="airbyte-integrations/connectors/destination-databricks"
if [[ -f "${connector_path}/lib/${driver_file}" ]] ; then
echo "[Databricks] Spark JDBC driver already exists"
else
echo "[Databricks] Downloading Spark JDBC driver..."
curl -o "${connector_path}/lib/${driver_zip}" "${driver_url}"
echo "[Databricks] Extracting Spark JDBC driver..."
unzip "${connector_path}/lib/${driver_zip}" "${driver_file}"
mv "${driver_file}" "${connector_path}/lib/"
rm "${connector_path}/lib/${driver_zip}"
fi
}