From 8b84461f3b5a12cf013a10a8284bf9099df15f7f Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Wed, 8 Oct 2025 16:50:39 -0700 Subject: [PATCH 01/18] Remove extra newlines that Vertica could not parse Without trimming the leading and trailing newlines, Vertica would fail to parse the compiled SQL. For example, `models/edr/dbt_artifacts/dbt_columns` compiles the following SQL, via `elementary.get_dbt_columns_empty_table_query`, `empty_table` and `empty_column`: ```sql select * from ( select cast('dummy_string' as varchar(4096)) as unique_id , cast('dummy_string' as varchar(4096)) as parent_unique_id , cast('dummy_string' as varchar(4096)) as name , cast('dummy_string' as varchar(4096)) as data_type , cast('this_is_just_a_long_dummy_string' as varchar(4096)) as tags , cast('this_is_just_a_long_dummy_string' as varchar(4096)) as meta , cast('dummy_string' as varchar(4096)) as database_name , cast('dummy_string' as varchar(4096)) as schema_name , cast('dummy_string' as varchar(4096)) as table_name , cast('this_is_just_a_long_dummy_string' as varchar(4096)) as description , cast('dummy_string' as varchar(4096)) as resource_type , cast('dummy_string' as varchar(4096)) as generated_at , cast('dummy_string' as varchar(4096)) as metadata_hash ) as empty_table where 1 = 0 ``` which would cause ``` SQL Error [4856] [42601]: [Vertica][VJDBC](4856) ERROR: Syntax error at or near ")" at character 1 ``` By trimming the newlines, the SQL is much tighter: ```sql select * from ( select cast('dummy_string' as varchar(4096)) as unique_id, cast('dummy_string' as varchar(4096)) as parent_unique_id, cast('dummy_string' as varchar(4096)) as name, cast('dummy_string' as varchar(4096)) as data_type, cast('this_is_just_a_long_dummy_string' as varchar(4096)) as tags, cast('this_is_just_a_long_dummy_string' as varchar(4096)) as meta, cast('dummy_string' as varchar(4096)) as database_name, cast('dummy_string' as varchar(4096)) as schema_name, cast('dummy_string' as varchar(4096)) as table_name, cast('this_is_just_a_long_dummy_string' as varchar(4096)) as description, cast('dummy_string' as varchar(4096)) as resource_type, cast('dummy_string' as varchar(4096)) as generated_at, cast('dummy_string' as varchar(4096)) as metadata_hash ) as empty_table where 1 = 0 ``` and this runs in Vertica just fine. --- macros/edr/system/system_utils/empty_table.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros/edr/system/system_utils/empty_table.sql b/macros/edr/system/system_utils/empty_table.sql index 07ccc3e4d..8987f52d4 100644 --- a/macros/edr/system/system_utils/empty_table.sql +++ b/macros/edr/system/system_utils/empty_table.sql @@ -121,7 +121,7 @@ {%- set empty_table_query -%} select * from ( select - {% for column in column_name_and_type_list %} + {%- for column in column_name_and_type_list -%} {{ elementary.empty_column(column[0], column[1]) }} {%- if not loop.last -%},{%- endif %} {%- endfor %} ) as empty_table @@ -161,7 +161,7 @@ cast({{ dummy_values['int'] }} as Nullable({{ elementary.edr_type_int() }})) as {{ column_name }} {%- else %} cast('{{ dummy_values['string'] }}' as {{ elementary.edr_type_string() }}) as {{ column_name }} - {%- endif %} + {%- endif -%} {% endmacro %} From 7146da5f6acd70c779014c9d523a29ac0a7819d1 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Mon, 17 Nov 2025 14:05:54 -0800 Subject: [PATCH 02/18] Add Vertica-specific escape macro This fixed 4 or 5 errors when running in my test project. --- macros/utils/table_operations/insert_rows.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/macros/utils/table_operations/insert_rows.sql b/macros/utils/table_operations/insert_rows.sql index aa278027a..48c840805 100644 --- a/macros/utils/table_operations/insert_rows.sql +++ b/macros/utils/table_operations/insert_rows.sql @@ -149,6 +149,10 @@ {{- return(string_value | replace("'", "''")) -}} {%- endmacro -%} +{%- macro vertica__escape_special_chars(string_value) -%} + {{- return(string_value | replace("'", "''")) -}} +{%- endmacro -%} + {%- macro athena__escape_special_chars(string_value) -%} {{- return(string_value | replace("'", "''")) -}} {%- endmacro -%} From 27e924d4393d60b5da5381b13e37b872d2251296 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Mon, 17 Nov 2025 14:26:27 -0800 Subject: [PATCH 03/18] Add Vertica-specific timeadd macro --- macros/utils/cross_db_utils/timeadd.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/macros/utils/cross_db_utils/timeadd.sql b/macros/utils/cross_db_utils/timeadd.sql index 0f2419e86..69d46c938 100644 --- a/macros/utils/cross_db_utils/timeadd.sql +++ b/macros/utils/cross_db_utils/timeadd.sql @@ -22,6 +22,10 @@ {{ elementary.edr_cast_as_timestamp(timestamp_expression) }} + {{ elementary.edr_cast_as_int(number) }} * INTERVAL '1 {{ date_part }}' {% endmacro %} +{% macro vertica__edr_timeadd(date_part, number, timestamp_expression) %} + timestampadd({{ date_part | upper }}, {{ elementary.edr_cast_as_int(number) }}, {{ elementary.edr_cast_as_timestamp(timestamp_expression) }}) +{% endmacro %} + {% macro redshift__edr_timeadd(date_part, number, timestamp_expression) %} dateadd({{ date_part }}, {{ elementary.edr_cast_as_int(number) }}, {{ elementary.edr_cast_as_timestamp(timestamp_expression) }}) {% endmacro %} From 667054b42818fa98b6ce1133adb7395bb5f526af Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Mon, 17 Nov 2025 14:50:13 -0800 Subject: [PATCH 04/18] Attempt to set up Vertica in CI --- .github/workflows/test-all-warehouses.yml | 3 ++ .github/workflows/test-warehouse.yml | 6 ++++ integration_tests/docker-compose-vertica.yml | 31 ++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 integration_tests/docker-compose-vertica.yml diff --git a/.github/workflows/test-all-warehouses.yml b/.github/workflows/test-all-warehouses.yml index c5e7ad4d1..ce7388e13 100644 --- a/.github/workflows/test-all-warehouses.yml +++ b/.github/workflows/test-all-warehouses.yml @@ -49,6 +49,7 @@ jobs: trino, clickhouse, dremio, + vertica, ] include: - dbt-version: "${{ inputs.dbt-version || 'latest_pre' }}" @@ -61,6 +62,8 @@ jobs: warehouse-type: redshift - dbt-version: "${{ inputs.dbt-version || 'fusion' }}" warehouse-type: databricks_catalog + - dbt-version: "${{ inputs.dbt-version || '1.8.5' }}" + warehouse-type: vertica uses: ./.github/workflows/test-warehouse.yml with: warehouse-type: ${{ matrix.warehouse-type }} diff --git a/.github/workflows/test-warehouse.yml b/.github/workflows/test-warehouse.yml index 65bed62cd..c72ebc414 100644 --- a/.github/workflows/test-warehouse.yml +++ b/.github/workflows/test-warehouse.yml @@ -17,6 +17,7 @@ on: - trino - clickhouse - dremio + - vertica elementary-ref: type: string required: false @@ -109,6 +110,11 @@ jobs: working-directory: ${{ env.TESTS_DIR }} run: docker compose -f docker-compose-dremio.yml up -d + - name: Start Vertica + if: inputs.warehouse-type == 'vertica' + working-directory: ${{ env.TESTS_DIR }} + run: docker compose -f docker-compose-vertica.yml up -d + - name: Setup Python uses: actions/setup-python@v4 with: diff --git a/integration_tests/docker-compose-vertica.yml b/integration_tests/docker-compose-vertica.yml new file mode 100644 index 000000000..4643c0d21 --- /dev/null +++ b/integration_tests/docker-compose-vertica.yml @@ -0,0 +1,31 @@ +services: + vertica: + environment: + VERTICA_USER: dbadmin + VERTICA_PASS: vertica + VERTICA_HOST: localhost + VERTICA_PORT: 5433 + VERTICA_DATABASE: elementary_tests + VERTICA_SCHEMA: elementary_tests_vertica + APP_DB_USER: ${VERTICA_USER} + APP_DB_PASSWORD: ${VERTICA_PASS} + TZ: "America/Los_Angeles" + VERTICA_DB_NAME: ${VERTICA_DATABASE} + VMART_ETL_SCRIPT: "" + container_name: vertica + image: vertica/vertica-ce + ports: + - "${VERTICA_PORT}:${VERTICA_PORT}" + - "5444:5444" + deploy: + mode: global + ulimits: + nofile: + soft: 65536 + hard: 65536 + volumes: + - type: volume + source: vertica-data + target: /data +volumes: + vertica-data: From 2130a7a90e06440208e4b058433d31bd670b8992 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Mon, 17 Nov 2025 14:58:08 -0800 Subject: [PATCH 05/18] Debug missing port --- .github/workflows/test-warehouse.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-warehouse.yml b/.github/workflows/test-warehouse.yml index c72ebc414..2e5a22732 100644 --- a/.github/workflows/test-warehouse.yml +++ b/.github/workflows/test-warehouse.yml @@ -111,6 +111,8 @@ jobs: run: docker compose -f docker-compose-dremio.yml up -d - name: Start Vertica + env: + VERTICA_PORT: 5433 if: inputs.warehouse-type == 'vertica' working-directory: ${{ env.TESTS_DIR }} run: docker compose -f docker-compose-vertica.yml up -d From d7a9c0f1e9813269a2c2fdf1caa3fc72d9f163f1 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Mon, 17 Nov 2025 15:00:22 -0800 Subject: [PATCH 06/18] Add more missing env vars for CI I thought I might have to add these and not just `VERTICA_PORT`. --- .github/workflows/test-warehouse.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-warehouse.yml b/.github/workflows/test-warehouse.yml index 2e5a22732..17611dae1 100644 --- a/.github/workflows/test-warehouse.yml +++ b/.github/workflows/test-warehouse.yml @@ -113,6 +113,10 @@ jobs: - name: Start Vertica env: VERTICA_PORT: 5433 + VERTICA_USER: dbadmin + VERTICA_PASS: vertica + VERTICA_DATABASE: elementary_tests + VERTICA_SCHEMA: elementary_tests_vertica if: inputs.warehouse-type == 'vertica' working-directory: ${{ env.TESTS_DIR }} run: docker compose -f docker-compose-vertica.yml up -d From 8d1975ddd01c1f82b7f2235664b7561139216f7d Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Mon, 17 Nov 2025 15:06:12 -0800 Subject: [PATCH 07/18] Try opentext namespace for CI image --- integration_tests/docker-compose-vertica.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/docker-compose-vertica.yml b/integration_tests/docker-compose-vertica.yml index 4643c0d21..09ced56c0 100644 --- a/integration_tests/docker-compose-vertica.yml +++ b/integration_tests/docker-compose-vertica.yml @@ -13,7 +13,7 @@ services: VERTICA_DB_NAME: ${VERTICA_DATABASE} VMART_ETL_SCRIPT: "" container_name: vertica - image: vertica/vertica-ce + image: opentext/vertica-ce ports: - "${VERTICA_PORT}:${VERTICA_PORT}" - "5444:5444" From fe2585ef9825c048fff955db13169a326af8a83e Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Mon, 17 Nov 2025 15:16:56 -0800 Subject: [PATCH 08/18] Use Ratio's Vertica-CE I can't tell if OpenText pulled Vertica or what, but both the vertica and opentext namespaces were failing. Luckily I had the image pulled locally. --- integration_tests/docker-compose-vertica.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/docker-compose-vertica.yml b/integration_tests/docker-compose-vertica.yml index 09ced56c0..6bc8ef012 100644 --- a/integration_tests/docker-compose-vertica.yml +++ b/integration_tests/docker-compose-vertica.yml @@ -13,7 +13,7 @@ services: VERTICA_DB_NAME: ${VERTICA_DATABASE} VMART_ETL_SCRIPT: "" container_name: vertica - image: opentext/vertica-ce + image: ratiopbc/vertica-ce ports: - "${VERTICA_PORT}:${VERTICA_PORT}" - "5444:5444" From 21541637ce30f1fa1b123ad59f571b9aa84c8f79 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Tue, 18 Nov 2025 10:17:03 -0800 Subject: [PATCH 09/18] Add dbt-vertica-version dbt-vertica versions match dbt-core versions, and they are a bit behind, which is why we default to the latest available: 1.8.5. --- .github/workflows/test-warehouse.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-warehouse.yml b/.github/workflows/test-warehouse.yml index 17611dae1..30c587e80 100644 --- a/.github/workflows/test-warehouse.yml +++ b/.github/workflows/test-warehouse.yml @@ -31,6 +31,11 @@ on: required: false default: "latest_official" description: dbt's version to test with + dbt-vertica-version: + type: string + required: false + default: "1.8.5" + description: dbt-vertica's version to test with workflow_call: inputs: @@ -47,6 +52,10 @@ on: type: string default: "latest_official" required: false + dbt-vertica-version: + type: string + default: "1.8.5" + required: false env: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} @@ -135,8 +144,13 @@ jobs: if: startsWith(inputs.warehouse-type, 'databricks') && inputs.dbt-version < '1.7.0' run: pip install databricks-sql-connector==2.9.3 + - name: Install dbt-vertica + if: ${{ inputs.warehouse-type == 'vertica' }} + run: + pip install "dbt-vertica==${{ inputs.dbt-vertica-version }}" + - name: Install dbt - if: ${{ inputs.dbt-version != 'fusion' }} + if: ${{ inputs.dbt-version != 'fusion' && inputs.warehouse-type != 'vertica' }} run: pip install${{ (inputs.dbt-version == 'latest_pre' && ' --pre') || '' }} "dbt-core${{ (!startsWith(inputs.dbt-version, 'latest') && format('=={0}', inputs.dbt-version)) || '' }}" From 19e41b55cad84fd37fd20ec102bdb062d0f14550 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Tue, 18 Nov 2025 11:08:35 -0800 Subject: [PATCH 10/18] Start Vertica after schema has been determined --- .github/workflows/test-warehouse.yml | 26 +++++++++++--------- integration_tests/docker-compose-vertica.yml | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-warehouse.yml b/.github/workflows/test-warehouse.yml index 30c587e80..a68b010f2 100644 --- a/.github/workflows/test-warehouse.yml +++ b/.github/workflows/test-warehouse.yml @@ -119,17 +119,6 @@ jobs: working-directory: ${{ env.TESTS_DIR }} run: docker compose -f docker-compose-dremio.yml up -d - - name: Start Vertica - env: - VERTICA_PORT: 5433 - VERTICA_USER: dbadmin - VERTICA_PASS: vertica - VERTICA_DATABASE: elementary_tests - VERTICA_SCHEMA: elementary_tests_vertica - if: inputs.warehouse-type == 'vertica' - working-directory: ${{ env.TESTS_DIR }} - run: docker compose -f docker-compose-vertica.yml up -d - - name: Setup Python uses: actions/setup-python@v4 with: @@ -171,7 +160,9 @@ jobs: mkdir -p ~/.dbt DBT_VERSION=$(echo "${{ inputs.dbt-version }}" | sed 's/\.//g') UNDERSCORED_REF_NAME=$(echo "${{ inputs.warehouse-type }}_dbt_${DBT_VERSION}_${BRANCH_NAME}" | awk '{print tolower($0)}' | head -c 40 | sed "s/[-\/]/_/g") - echo "$PROFILES_YML" | base64 -d | sed "s//dbt_pkg_$UNDERSCORED_REF_NAME/g" > ~/.dbt/profiles.yml + SCHEMA_NAME="dbt_pkg_$UNDERSCORED_REF_NAME" + echo "SCHEMA_NAME=$SCHEMA_NAME" >> $GITHUB_ENV + echo "$PROFILES_YML" | base64 -d | sed "s//$SCHEMA_NAME/g" > ~/.dbt/profiles.yml - name: Install dependencies working-directory: ${{ env.TESTS_DIR }} @@ -180,6 +171,17 @@ jobs: ln -sfn ${{ github.workspace }}/dbt-data-reliability dbt_project/dbt_packages/elementary pip install -r requirements.txt + - name: Start Vertica + env: + VERTICA_PORT: 5433 + VERTICA_USER: dbadmin + VERTICA_PASS: vertica + VERTICA_DATABASE: elementary_tests + VERTICA_SCHEMA: ${{ env.SCHEMA_NAME }} + if: inputs.warehouse-type == 'vertica' + working-directory: ${{ env.TESTS_DIR }} + run: docker compose -f docker-compose-vertica.yml up -d + - name: Check DWH connection working-directory: ${{ env.TESTS_DIR }} run: | diff --git a/integration_tests/docker-compose-vertica.yml b/integration_tests/docker-compose-vertica.yml index 6bc8ef012..19c8d2778 100644 --- a/integration_tests/docker-compose-vertica.yml +++ b/integration_tests/docker-compose-vertica.yml @@ -6,7 +6,7 @@ services: VERTICA_HOST: localhost VERTICA_PORT: 5433 VERTICA_DATABASE: elementary_tests - VERTICA_SCHEMA: elementary_tests_vertica + VERTICA_SCHEMA: ${SCHEMA_NAME} APP_DB_USER: ${VERTICA_USER} APP_DB_PASSWORD: ${VERTICA_PASS} TZ: "America/Los_Angeles" From c585daebf2c03728872cc8d421e2092dc67cc038 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Tue, 18 Nov 2025 11:30:39 -0800 Subject: [PATCH 11/18] Use Ratio's GitHub package for vertica-ce This should be a lot faster than pulling from docker.io --- integration_tests/docker-compose-vertica.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/docker-compose-vertica.yml b/integration_tests/docker-compose-vertica.yml index 19c8d2778..1664de5f9 100644 --- a/integration_tests/docker-compose-vertica.yml +++ b/integration_tests/docker-compose-vertica.yml @@ -13,7 +13,7 @@ services: VERTICA_DB_NAME: ${VERTICA_DATABASE} VMART_ETL_SCRIPT: "" container_name: vertica - image: ratiopbc/vertica-ce + image: ghcr.io/ratiopbc/vertica-ce ports: - "${VERTICA_PORT}:${VERTICA_PORT}" - "5444:5444" From d198a9e2e68391568779f267eed3f6688be50431 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Tue, 18 Nov 2025 11:46:23 -0800 Subject: [PATCH 12/18] Set Vertica env vars & persist across steps --- .github/workflows/test-warehouse.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-warehouse.yml b/.github/workflows/test-warehouse.yml index a68b010f2..378ef3348 100644 --- a/.github/workflows/test-warehouse.yml +++ b/.github/workflows/test-warehouse.yml @@ -171,13 +171,16 @@ jobs: ln -sfn ${{ github.workspace }}/dbt-data-reliability dbt_project/dbt_packages/elementary pip install -r requirements.txt + - name: Set Vertica environment variables + if: inputs.warehouse-type == 'vertica' + run: | + echo "VERTICA_PORT=5433" >> $GITHUB_ENV + echo "VERTICA_USER=dbadmin" >> $GITHUB_ENV + echo "VERTICA_PASS=vertica" >> $GITHUB_ENV + echo "VERTICA_DATABASE=elementary_tests" >> $GITHUB_ENV + echo "VERTICA_SCHEMA=$SCHEMA_NAME" >> $GITHUB_ENV + - name: Start Vertica - env: - VERTICA_PORT: 5433 - VERTICA_USER: dbadmin - VERTICA_PASS: vertica - VERTICA_DATABASE: elementary_tests - VERTICA_SCHEMA: ${{ env.SCHEMA_NAME }} if: inputs.warehouse-type == 'vertica' working-directory: ${{ env.TESTS_DIR }} run: docker compose -f docker-compose-vertica.yml up -d From 570dcd0491e87fc4c05ec626a4955c9a8a355939 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Tue, 18 Nov 2025 11:50:28 -0800 Subject: [PATCH 13/18] Forgot VERTICA_HOST --- .github/workflows/test-warehouse.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-warehouse.yml b/.github/workflows/test-warehouse.yml index 378ef3348..593797a5d 100644 --- a/.github/workflows/test-warehouse.yml +++ b/.github/workflows/test-warehouse.yml @@ -175,6 +175,7 @@ jobs: if: inputs.warehouse-type == 'vertica' run: | echo "VERTICA_PORT=5433" >> $GITHUB_ENV + echo "VERTICA_HOST=localhost" >> $GITHUB_ENV echo "VERTICA_USER=dbadmin" >> $GITHUB_ENV echo "VERTICA_PASS=vertica" >> $GITHUB_ENV echo "VERTICA_DATABASE=elementary_tests" >> $GITHUB_ENV From bd695078a97a4647c8915824b70a5a5735fdeae1 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Tue, 18 Nov 2025 12:48:29 -0800 Subject: [PATCH 14/18] Address CodeRabbit nit --- .github/workflows/test-warehouse.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-warehouse.yml b/.github/workflows/test-warehouse.yml index 593797a5d..857c031f0 100644 --- a/.github/workflows/test-warehouse.yml +++ b/.github/workflows/test-warehouse.yml @@ -134,7 +134,7 @@ jobs: run: pip install databricks-sql-connector==2.9.3 - name: Install dbt-vertica - if: ${{ inputs.warehouse-type == 'vertica' }} + if: inputs.warehouse-type == 'vertica' run: pip install "dbt-vertica==${{ inputs.dbt-vertica-version }}" From c886e4ce25fee56d8c7377b503763ea625b49148 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Tue, 18 Nov 2025 14:36:19 -0800 Subject: [PATCH 15/18] Try a healthcheck before moving on with Vertica I'm seeing `Database Error: [Errno 32] Broken pipe` in the `Check DWH connection` step. --- .github/workflows/test-warehouse.yml | 7 +++++++ integration_tests/docker-compose-vertica.yml | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/test-warehouse.yml b/.github/workflows/test-warehouse.yml index 857c031f0..455df6b45 100644 --- a/.github/workflows/test-warehouse.yml +++ b/.github/workflows/test-warehouse.yml @@ -186,6 +186,13 @@ jobs: working-directory: ${{ env.TESTS_DIR }} run: docker compose -f docker-compose-vertica.yml up -d + - name: Wait for Vertica to be ready + if: inputs.warehouse-type == 'vertica' + run: | + echo "Waiting for Vertica to be healthy..." + timeout 60 bash -c 'until [ "$(docker inspect --format="{{.State.Health.Status}}" vertica)" == "healthy" ]; do echo "Waiting..."; sleep 5; done' + echo "Vertica is ready!" + - name: Check DWH connection working-directory: ${{ env.TESTS_DIR }} run: | diff --git a/integration_tests/docker-compose-vertica.yml b/integration_tests/docker-compose-vertica.yml index 1664de5f9..dca568117 100644 --- a/integration_tests/docker-compose-vertica.yml +++ b/integration_tests/docker-compose-vertica.yml @@ -27,5 +27,10 @@ services: - type: volume source: vertica-data target: /data + healthcheck: + test: ["CMD-SHELL", "/opt/vertica/bin/vsql -U dbadmin -w vertica -c 'SELECT 1;'"] + interval: 5s + timeout: 5s + retries: 10 volumes: vertica-data: From bcc9d8083e59f0c1d3cb9e401958dc7a29823a20 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Tue, 18 Nov 2025 15:43:00 -0800 Subject: [PATCH 16/18] Use env vars for Vertica healthcheck --- integration_tests/docker-compose-vertica.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/docker-compose-vertica.yml b/integration_tests/docker-compose-vertica.yml index dca568117..bae881fb7 100644 --- a/integration_tests/docker-compose-vertica.yml +++ b/integration_tests/docker-compose-vertica.yml @@ -28,7 +28,7 @@ services: source: vertica-data target: /data healthcheck: - test: ["CMD-SHELL", "/opt/vertica/bin/vsql -U dbadmin -w vertica -c 'SELECT 1;'"] + test: ["CMD-SHELL", "/opt/vertica/bin/vsql -U ${VERTICA_USER} -w ${VERTICA_PASS} -c 'SELECT 1;'"] interval: 5s timeout: 5s retries: 10 From 9a2bf01fa4003e54c1575fb224833feddcdbe266 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Tue, 18 Nov 2025 15:43:36 -0800 Subject: [PATCH 17/18] Add test/CI profiles.yml fixture file I use this for local dev via `DBT_PROFILES_DIR="path/to/.github/fixtures/" and for GitHub Actions secret `CI_PROFILES_YML`. Linux+Wayland: `base64 .github/fixtures/profiles.yml | wl-copy` MacOS: `base64 .github/fixtures/profiles.yml | pbcopy` --- .github/fixtures/profiles.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/fixtures/profiles.yml diff --git a/.github/fixtures/profiles.yml b/.github/fixtures/profiles.yml new file mode 100644 index 000000000..7394d01a5 --- /dev/null +++ b/.github/fixtures/profiles.yml @@ -0,0 +1,29 @@ +elementary: + target: vertica + outputs: + vertica: + type: vertica + host: "{{ env_var('VERTICA_HOST') }}" + port: "{{ env_var('VERTICA_PORT') | as_number }}" + username: "{{ env_var('VERTICA_USER') }}" + password: "{{ env_var('VERTICA_PASS') }}" + database: "{{ env_var('VERTICA_DATABASE') }}" + schema: "{{ env_var('SCHEMA_NAME') }}" + connection_load_balance: false + retries: 2 + threads: 4 + +elementary_tests: + target: vertica + outputs: + vertica: + type: vertica + host: "{{ env_var('VERTICA_HOST') }}" + port: "{{ env_var('VERTICA_PORT') | as_number }}" + username: "{{ env_var('VERTICA_USER') }}" + password: "{{ env_var('VERTICA_PASS') }}" + database: "{{ env_var('VERTICA_DATABASE') }}" + schema: "{{ env_var('SCHEMA_NAME') }}" + connection_load_balance: false + retries: 2 + threads: 4 From 2a996ef6951a309364675cf079e6b5cea70eb943 Mon Sep 17 00:00:00 2001 From: Jesse Cooke Date: Tue, 18 Nov 2025 15:47:57 -0800 Subject: [PATCH 18/18] Ignore the .user.yml in the fixtures dir --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5172d726c..93a57e825 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dbt_internal_packages/ logs/ scripts/ +.github/fixtures/.user.yml .idea .DS_Store