Uses vertica-python to connect to Vertica database.
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 |
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 |
unique_id
as it wasn't implementedunique_field
property on connection, supporting 0.21.x.pip install dbt-vertica
You don't need to install dbt separately. Installing dbt-vertica
will also install dbt-core
and vertica-python
.
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.
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.)
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
Version | Tag | Published |
---|---|---|
1.0.3.1 | 5mos ago | |
1.0.3 | 5mos ago | |
1.0.2 | 6mos ago | |
1.0.1 | 6mos ago |