From 3e3abb37f26e21621b833fb03e75cd4b961d7b05 Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Thu, 1 Feb 2024 17:46:02 -0500 Subject: [PATCH] Fix contact validation failure on query data types change (#862) (#1083) * add current_timestamp to prevent empty query caching * add changie log (cherry picked from commit 1b8cae258618106eb4e2af747d464696c14bb8ba) Co-authored-by: Mykola Dementiev --- .changes/unreleased/Fixes-20230804-005817.yaml | 6 ++++++ dbt/include/bigquery/macros/adapters/columns.sql | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .changes/unreleased/Fixes-20230804-005817.yaml create mode 100644 dbt/include/bigquery/macros/adapters/columns.sql diff --git a/.changes/unreleased/Fixes-20230804-005817.yaml b/.changes/unreleased/Fixes-20230804-005817.yaml new file mode 100644 index 000000000..34e0601e1 --- /dev/null +++ b/.changes/unreleased/Fixes-20230804-005817.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fix contact validation failure on query data types change +time: 2023-08-04T00:58:17.97704+03:00 +custom: + Author: dementiev27 + Issue: "861" diff --git a/dbt/include/bigquery/macros/adapters/columns.sql b/dbt/include/bigquery/macros/adapters/columns.sql new file mode 100644 index 000000000..c540f1e2d --- /dev/null +++ b/dbt/include/bigquery/macros/adapters/columns.sql @@ -0,0 +1,10 @@ +{% macro bigquery__get_empty_subquery_sql(select_sql, select_sql_header=none) %} + {%- if select_sql_header is not none -%} + {{ select_sql_header }} + {%- endif -%} + select * from ( + {{ select_sql }} + ) as __dbt_sbq + where false and current_timestamp() = current_timestamp() + limit 0 +{% endmacro %}