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.

Supported Features

dbt Core Features

Below is a table for what features the current Vertica adapter supports for dbt. This is constantly improving and changing as both dbt adds new functionality, as well as the dbt-vertica driver improves. This list is based upon dbt 1.0.3.

dbt Core Features Supported
Table Materializations Yes
Ephemeral Materializations Yes
View Materializations Yes
Incremental Materializations - Append Untested
Incremental Materailizations - Insert + Overwrite Yes
Incremental Materializations - Merge Yes
Snapshots - Timestamp Passes Test
Snapshots - Check Cols Passes Test
Seeds Yes
Tests Yes
Documentation Yes
External Tables Untested
  • Yes - Supported, and tests pass.
  • No - Not supported or implemented.
  • Untested - May support out of the box, though hasn't been tested.
  • Passes Test -The testes have passed, though haven't tested in a production like environment

Vertica Features

Below is a table for what features the current Vertica adapter supports for Vertica. This is constantly improving and changing as both dbt adds new functionality, as well as the dbt-vertica driver improves.

Vertica Features Supported
Created/Drop Schema Yes
Analyze Statistics No
Purge Delete Vectors No
Projection Management No
Primary/Unique Keys No
Other DDLs No

Changes

1.0.3

  • Refactored the adapter to model after dbt's global_project macros
  • Unimplemented functions should throw an exception that it's not implemented. If you stumble across this, please open an Issue or PR so we can investigate.

1.0.2

  • Added support for snapshot timestamp with passing tests
  • Added support for snapshot check cols with passing tests

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.3.1.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

dbt_vertica-1.0.3.1-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dbt-vertica-1.0.3.1.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for dbt-vertica-1.0.3.1.tar.gz
Algorithm Hash digest
SHA256 5a9b732e8a59da92ca5a23890c9b0a6e4edb77f771287c155f6e343b3b628631
MD5 4df34d0ba35dfac9d1c5346ebe09ac33
BLAKE2b-256 78337d881fed60b541bf659b6fcb2e785dcb831b4532cd5ba3924138c9a1e004

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dbt_vertica-1.0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 61a6e1bfca0dfd735961fa88af5573cae581ce582ac42135b7c4707159ecd3ea
MD5 67c567712d94a2f3208d94ff17ca86a3
BLAKE2b-256 e604700d384809ddd9fed9a5b7f4343a2bd71c620c8788e2478e9d6cc301334c

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