Skip to main content

Official vertica adapter plugin for dbt (data build tool)

Project description

dbt-vertica

PyPI version License

dbt adapter for Vertica. The adapter uses vertica-python to connect to your Vertica database.

For more information on using dbt with Vertica, consult the Vertica-Setup and Configuration pages.

dbt-vertica Versions Tested

dbt-vertica has been developed using the following software and versions:

  • Vertica Server 23.4.0-0
  • Python 3.11
  • vertica-python client 1.3.1
  • dbt-core 1.8.5
  • dbt-tests-adapter 1.8.0

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.3.0

dbt Core Features Supported
Table Materializations Yes
Ephemeral Materializations Yes
View Materializations Yes
Incremental Materializations - Append Yes
Incremental Materailizations - Merge Yes
Incremental Materializations - Delete+Insert Yes
Incremental Materializations - Insert_Overwrite Yes
Snapshots - Timestamp Yes
Snapshots - Check Cols No
Seeds Yes
Tests Yes
Documentation Yes
External Tables Untested
Unit Testing Yes
  • 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 tests have passed, though haven't tested in a production like environment.

Installation

$ 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: [hostname]
      port: [port] # or your custom port (optional)
      username: [your username] 
      password: [your password] 
      database: [database name] 
      oauth_access_token: [access token]
      schema: [dbt schema] 
      connection_load_balance: True
      backup_server_node: [list of backup hostnames or IPs]
      retries: [1 or more]
      threads: [1 or more] 
      autocommit: False
  target: dev

Description of Profile Fields:

Property Description Required? Default Value Example
type The specific adapter to use. Yes None vertica
host The host name or IP address of any active node in the Vertica Server. Yes None 127.0.0.1
port The port to use, default or custom. Yes 5433 5433
username The username to use to connect to the server. Yes None dbadmin
password The password to use for authenticating to the server. Yes None my_password
database The name of the database running on the server. Yes None my_db
oauth_access_token To authenticate via OAuth, provide an OAuth Access Token that authorizes a user to the database. No "" Default: ""
schema The schema to build models into. No None VMart
connection_load_balance A Boolean value that indicates whether the connection can be redirected to a host in the database other than host. No true true
backup_server_node List of hosts to connect to if the primary host specified in the connection (host, port) is unreachable. Each item in the list should be either a host string (using default port 5433) or a (host, port) tuple. A host can be a host name or an IP address. No none ['123.123.123.123','www.abc.com',('123.123.123.124',5433)]
retries The retry times after an unsuccessful connection. No 2 3
threads The number of threads the dbt project will run on. No 1 3
autocommit Connection autocommit(True/False) Yes False True
label A session label to identify the connection. No An auto-generated label with format of: dbt_username dbt_dbadmin

For more information on Vertica’s connection properties please refer to Vertica-Python Connection Properties.

Changelog

See the changelog

Contributing guidelines

Have a bug or an idea? Please see CONTRIBUTING.md for details

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  dbt-tests-adapter==1.5.0

Run tests via:

pytest tests/functional/adapter/
# run an individual test 
pytest tests/functional/adapter/test_basic.py

Run Unit test via:

dbt test --select /{foldername}/{unit_test_file}

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

Uploaded Source

Built Distribution

dbt_vertica-1.8.5-py3-none-any.whl (51.2 kB view details)

Uploaded Python 3

File details

Details for the file dbt_vertica-1.8.5.tar.gz.

File metadata

  • Download URL: dbt_vertica-1.8.5.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dbt_vertica-1.8.5.tar.gz
Algorithm Hash digest
SHA256 f228c7c676d7a556331caf6742f8f48444a428f8a07a8d7d5d903a37fdb937fa
MD5 7006715a1b1830b921a2a2309098c242
BLAKE2b-256 f047f873cc2a7671da6f64ff95028706510ccc29e9cc26c1cd75d79434688965

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbt_vertica-1.8.5.tar.gz:

Publisher: python-publish.yml on vertica/dbt-vertica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: dbt_vertica-1.8.5-py3-none-any.whl
  • Upload date:
  • Size: 51.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dbt_vertica-1.8.5-py3-none-any.whl
Algorithm Hash digest
SHA256 31d2b1fc9c68d2f4142bb06f9ef018399008d48ccd3796849fd9647926ccfc56
MD5 665aaa3483639c4c938e6d450b8dad3d
BLAKE2b-256 1549770c7dee5dedf19b20f0a6f4a72eff0d0302cd1dbc5321e1c0c32a673729

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbt_vertica-1.8.5-py3-none-any.whl:

Publisher: python-publish.yml on vertica/dbt-vertica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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