Vertica connection

Vertica connection

Connect a task to a Vertica analytics database (the VerticaHook) over a managed Leoflow Connection. The database lives in the Schema field.

Declare the provider

# leoflow.yaml
dag_id: vertica_smoke
connectors:
  - vertica

URI shape

vertica://<login>:<password>@<host>:<port>/<database>

The control plane builds this URI from the Connection’s fields. Reserved characters in the password (e.g. @, :, /) are percent-escaped by the URI builder; VerticaHook un-escapes them back. The reserved-character round-trip is pinned by TestVerticaConnectionURIShapeIntegration (in internal/storage/).

Fields the UI asks for

FieldRequiredNotes
Conn Idyese.g. vertica_target. Exported as AIRFLOW_CONN_VERTICA_TARGET (uppercased).
Conn Typeyesvertica.
HostyesDNS name or IP.
SchemayesThe database name.
LoginyesThe Vertica user.
PasswordyesStored encrypted at rest (ADR 0019).
PortoptionalDefaults to 5433.
ExtraoptionalJSON — e.g. {"ssl":true} to force TLS. Encrypted at rest.

Example DAG

The provider import must live inside the task body — a top-level provider import fails compilation in the parser sidecar.

# dag.py
from airflow.sdk import DAG, task


@task
def query():
    from airflow.providers.vertica.hooks.vertica import VerticaHook

    hook = VerticaHook(vertica_conn_id="vertica_target")
    rows = hook.get_records("SELECT version()")
    print("vertica up:", rows)


with DAG("vertica_smoke", schedule=None, catchup=False, tags=["example"]):
    query()
# leoflow.yaml
schema_version: "1.0"
dag_id: vertica_smoke
python_version: "3.11"
connectors:
  - vertica

Security notes

  • Secrets in logs: never print() the URI itself — it carries the password. Log host + port + database only.
  • TLS in transit: set {"ssl":true} in Extra to force TLS.
  • gRPC channel (agent ↔ control plane): Connections are only served over an authenticated channel (see #58 + ADR 0021).
  • ADR 0019 — secret encryption at rest.
  • ADR 0021 — agent secret delivery (AIRFLOW_CONN_<CONN_ID>).
  • #142 — connector cookbook umbrella.