From 7865a52effc71f272d0a30166c889282c0bdf5df Mon Sep 17 00:00:00 2001 From: Priya Poojari <priya.poojari@niveussolutions.com> Date: Mon, 17 Feb 2025 14:16:50 +0000 Subject: [PATCH] updates --- definitions/aggregation_table.sqlx | 5 +++++ definitions/first_view.sqlx | 16 ---------------- definitions/second_view.sqlx | 6 ------ definitions/source_table.sqlx | 9 +++++++++ workflow_settings.yaml | 2 +- 5 files changed, 15 insertions(+), 23 deletions(-) create mode 100644 definitions/aggregation_table.sqlx delete mode 100644 definitions/first_view.sqlx delete mode 100644 definitions/second_view.sqlx create mode 100644 definitions/source_table.sqlx diff --git a/definitions/aggregation_table.sqlx b/definitions/aggregation_table.sqlx new file mode 100644 index 0000000..d210823 --- /dev/null +++ b/definitions/aggregation_table.sqlx @@ -0,0 +1,5 @@ +config { + type: "table", + description: "Description of the first table.", +} +SELECT SUM(number) AS total FROM ${ref("source_table")} \ No newline at end of file diff --git a/definitions/first_view.sqlx b/definitions/first_view.sqlx deleted file mode 100644 index f53a5f6..0000000 --- a/definitions/first_view.sqlx +++ /dev/null @@ -1,16 +0,0 @@ --- This is an example SQLX file to help you learn the basics of Dataform. --- Visit https://cloud.google.com/dataform/docs/sql-workflows for more information on how to configure your SQL workflow. - --- You can delete this file, then commit and push your changes to your repository when you are ready. - --- Config blocks allow you to configure, document, and test your data assets. -config { - type: "view", // Creates a view in BigQuery. Try changing to "table" instead. - columns: { - test: "A description for the test column", // Column descriptions are pushed to BigQuery. - } -} - --- The rest of a SQLX file contains your SELECT statement used to create the table. - -SELECT 1 as test diff --git a/definitions/second_view.sqlx b/definitions/second_view.sqlx deleted file mode 100644 index 9a47795..0000000 --- a/definitions/second_view.sqlx +++ /dev/null @@ -1,6 +0,0 @@ -config { type: "view" } - --- Use the ref() function to manage dependencies. --- Learn more about ref() and other built in functions here: https://cloud.google.com/dataform/docs/dataform-core - -SELECT test from ${ref("first_view")} diff --git a/definitions/source_table.sqlx b/definitions/source_table.sqlx new file mode 100644 index 0000000..a7ccd37 --- /dev/null +++ b/definitions/source_table.sqlx @@ -0,0 +1,9 @@ +config { + type: "table", + description: "Description of the first table.", +} +SELECT 1 AS number +UNION ALL +SELECT 5 AS number +UNION ALL +SELECT 3 AS number \ No newline at end of file diff --git a/workflow_settings.yaml b/workflow_settings.yaml index e09410c..07c4e33 100644 --- a/workflow_settings.yaml +++ b/workflow_settings.yaml @@ -1,5 +1,5 @@ defaultProject: maximal-chemist-355505 defaultLocation: asia-south1 -defaultDataset: dataform +defaultDataset: DFDemo defaultAssertionDataset: dataform_assertions dataformCoreVersion: 3.0.0 -- GitLab