diff --git a/.github/scripts/configure_odbc.sh b/.github/scripts/configure_odbc.sh new file mode 100644 index 000000000..e2bad8886 --- /dev/null +++ b/.github/scripts/configure_odbc.sh @@ -0,0 +1,23 @@ +set -e +sudo apt-get update && sudo apt-get install -y --no-install-recommends \ + g++ \ + unixodbc-dev \ + libsasl2-modules-gssapi-mit \ + unzip + +sudo apt-get install -y curl +rm -rf /tmp && mkdir /tmp + +curl -OL "https://databricks.com/wp-content/uploads/drivers-2020/SimbaSparkODBC-2.6.16.1019-Debian-64bit.zip" + +unzip SimbaSparkODBC-2.6.16.1019-Debian-64bit.zip -d /tmp/ +sudo dpkg -i /tmp/SimbaSparkODBC-*/*.deb +echo "--------------------------------------------" +sudo sh -c echo "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini + +rm -rf /tmp +sudo dpkg -l | grep Simba # confirm that the driver is installed + +sudo ldd /opt/simba/spark/lib/64/libsparkodbc_sb64.so +echo "--------------------------------------------" +odbcinst -j diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index b85e058e2..b9d6ddcbe 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -235,29 +235,7 @@ jobs: - name: Configure ODBC if: ${{ matrix.test != 'spark-databricks-http' }} run: | - set -e - sudo apt-get update && sudo apt-get install -y --no-install-recommends \ - g++ \ - unixodbc-dev \ - libsasl2-modules-gssapi-mit \ - unzip - - sudo apt-get install -y curl - rm -rf /tmp && mkdir /tmp - - curl -OL "https://databricks.com/wp-content/uploads/drivers-2020/SimbaSparkODBC-2.6.16.1019-Debian-64bit.zip" \ - - unzip SimbaSparkODBC-2.6.16.1019-Debian-64bit.zip -d /tmp/ - sudo dpkg -i /tmp/SimbaSparkODBC-*/*.deb - echo "--------------------------------------------" - sudo sh -c echo "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini \ - - rm -rf /tmp - sudo dpkg -l | grep Simba # confirm that the driver is installed - - sudo ldd /opt/simba/spark/lib/64/libsparkodbc_sb64.so - echo "--------------------------------------------" - odbcinst -j + ./.github/scripts/configure_odbc.sh - name: Run tox for Spark ${{ matrix.test }} run: tox -e integration-${{ matrix.test }}