question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow require_partition_filter=true for BigQuery table creation

See original GitHub issue

Describe the feature

I would like to have enable require_partition_filter=true in table and incremental mode. https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#table_option_list

for example, we could config model as

{{
  config (
    materialized='table',
    partition_by='DATE(stamp)',
    partition_by_required='true',
  )
}}

Currently, in 0.14.3, bigquery/adapters.sql, only persist_docs and temporary options is enable. Could we make bigquery_table_options macro below flexible to take in any other options, so that we could pass a generic key/value list in model config to create table options {% macro bigquery_table_options(persist_docs, temporary) %}

for example, we could config model as

{{
  config (
    materialized='table',
    partition_by='DATE(stamp)',
    options = '{ partition_by_required=true, partition_expiration_days=7 }'
  )
}}

Additional context

This feature is BigQuery-specific.

Who will this benefit?

This feature will benefit anyone who use BigQuery partition tables, and users of BigQuery in general.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
yu-iskwcommented, Dec 3, 2020

If no one hasn’t worked on it yet, I will send a PR.

5reactions
drewbanincommented, Oct 29, 2019

@soltanianalytics thanks so much for the heads up! The logic you implemented reminds me a lot of https://github.com/fishtown-analytics/dbt/issues/1034. I think this is a problem we’ll generally need to solve on BQ sometime soon - it’s great to know that these two pieces of functionality are related.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating partitioned tables | BigQuery - Google Cloud
Required permissions. To create a table, you need the following IAM permissions: bigquery.tables.create; bigquery.
Read more >
Allow require_partition_filter=true for BigQuery table creation
Describe the feature I would like to have enable require_partition_filter=true in table and incremental mode.
Read more >
Google BigQuery Create Table Command: 4 Easy Methods
In this article, you will learn about the Google BigQuery create table command, its usage, examples & how to query a table or...
Read more >
A Simple Way to Query Table Metadata in Google BigQuery
Let's explore this concept with Google BigQuery. ... List all tables and their creation time from a single dataset with TABLES view ...
Read more >
Set up BigQuery Export - Analytics Help - Google Help
Step 1: Create a Google API Console project and enable BigQuery; Step 2: Prepare your project for BigQuery Export ... Navigate to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found