Skip to main content

The vertica adapter plugin for dbt (data build tool)

Project description

dbt-vertica

Your dbt adapter for Vertica.

Uses vertica-python to connect to Vertica database.

Changes

1.0.1

  • Fixed the Incremental method implementation (was buggy/incomplete)
    • Removed the unique_id as it wasn't implemented
    • Fixed when no fields were added - full table merge
  • Added testing for Incremental materialization
    • Testing for dbt Incremental full table
    • Testing for dbt Incremental specified merged columns
  • Added more logging to the connector to help understand why tests were failing
  • Using the official Vertica CE 11.0.x docker image now for tests

1.0.0

  • Add support for DBT version 1.0.0

0.21.1

  • Add testing, fix schema drop.

0.21.0

  • Add unique_field property on connection, supporting 0.21.x.

0.20.2

  • Added SSL options.

0.20.1

  • Added the required changes from dbt 0.19.0. Details found here.
  • Added support for the MERGE command for incremental loading isntead of DELETE+INSERT

Install

pip install dbt-vertica

You don't need to install dbt separately. Installing dbt-vertica will also install dbt-core and vertica-python.

Sample Profile Configuration

your-profile:
  outputs:
    dev:
      type: vertica # Don't change this!
      host: vertica-host-name
      port: 5433 # or your custom port (optional)
      username: your-username
      password: your-password
      database: vertica-database-name
      schema: your-default-schema
  target: dev

By default, dbt-vertica will request ConnectionLoadBalance=true (which is generally a good thing), and set a session label of dbt_your-username.

There are three options for SSL: ssl, ssl_env_cafile, and ssl_uri. See their use in the code here.

Reach out!

First off, I would not have been able to make this adapater if the smart folks at dbt labs didn't make it so easy. That said, it seems every database has its own little quirks. I ran into several different issues when adapting the macros to Vertica. If you find something not working right, please open an issue (assuming it has to do with the adapter and not dbt itself).

Also, I would be excited to hear about anyone who is able to benefit from using dbt with Vertica. (Just open an issue to leave me a comment.)

Develop

Run a local Vertica instance like:

docker run -p 5433:5433 \
           -p 5444:5444 \
           -e VERTICA_DB_NAME=docker \
           -e VMART_ETL_SCRIPT="" \
           -e VMART_ETL_SQL="" \
           vertica/vertica-ce

Access the local Vertica instance like:

docker exec -it <docker_image_name> /opt/vertica/bin/vsql

You need the pytest dbt adapter:

pip3 install pytest-dbt-adapter==0.6.0

Run tests via:

pytest tests/integration.dbtspec
# run an individual test with increased logging:
pytest tests/integration.dbtspec::test_dbt_base -xs --ff

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt-vertica-1.0.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

dbt_vertica-1.0.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file dbt-vertica-1.0.1.tar.gz.

File metadata

  • Download URL: dbt-vertica-1.0.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for dbt-vertica-1.0.1.tar.gz
Algorithm Hash digest
SHA256 59c21bf81fd202630d9be505d9c60c25def42eaf15ca0e6d20eb6e84a832c907
MD5 f539a26380826e9eb8b2fcef189f6b9f
BLAKE2b-256 8747b9a436e93fcdb255fb34a9221a0e0748a5dc16c124bb0e13e49e45b43cde

See more details on using hashes here.

File details

Details for the file dbt_vertica-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dbt_vertica-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for dbt_vertica-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 903cca37f3132ad07af4f4ab6a19d765685e3dfa87a4c0f107b723ba395c1644
MD5 dabd615c74b428b1a062b47dd5e6b2e6
BLAKE2b-256 2a1794b5afb240b66f89fc0d8877020c796528c0d5ab54cb8b72b2053fd0d5c9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page