Files
Nishant Raghav 81c7213f92 feat(bigquery-dataset): add optional schema support for views (#3377)
* feat: add optional schema to BigQuery views for descriptions

* feat: add schema support for view definitions in BigQuery dataset module

* fix: encode schema as JSON for BigQuery views

* feat: add population schema and update query for population view in BigQuery dataset

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2025-10-06 05:40:39 +00:00

37 lines
1.3 KiB
YAML

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
values:
module.bigquery-dataset.google_bigquery_dataset.default:
dataset_id: my_dataset
location: EU
project: my-project
module.bigquery-dataset.google_bigquery_table.default["countries"]:
dataset_id: my_dataset
friendly_name: Countries
module.bigquery-dataset.google_bigquery_table.views["population"]:
dataset_id: my_dataset
deletion_protection: true
friendly_name: Population
project: my-project
table_id: population
schema: '[{"description":"Total population","mode":null,"name":"total","type":"INT64"}]'
view:
- query: SELECT SUM(population) AS total FROM my_dataset.countries
use_legacy_sql: false
counts:
google_bigquery_dataset: 1
google_bigquery_table: 2