GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add support for materialized views by tswast · Pull Request #408 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@tswast

@tswast tswast commented Dec 1, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #407 🦕

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tswast
feat: add support for materialized views
5f281b6
@tswast
tswast requested a review from a team December 1, 2020 21:38
@tswast
tswast requested a review from a team as a code owner December 1, 2020 21:38
@tswast
tswast requested a review from shollyman December 1, 2020 21:38
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Dec 1, 2020
@snippet-bot

snippet-bot Bot commented Dec 1, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Here is the summary of changes.

You added 6 region tags.
  • samples/snippets/materialized_view.py:17, tag bigquery_create_materialized_view
  • samples/snippets/materialized_view.py:29, tag bigquery_create_materialized_view
  • samples/snippets/materialized_view.py:45, tag bigquery_update_materialized_view
  • samples/snippets/materialized_view.py:56, tag bigquery_update_materialized_view
  • samples/snippets/materialized_view.py:73, tag bigquery_delete_materialized_view
  • samples/snippets/materialized_view.py:83, tag bigquery_delete_materialized_view

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Dec 1, 2020
shollyman
shollyman approved these changes Dec 1, 2020
View reviewed changes

@shollyman shollyman left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor naming ruminations, and a paste edit for the license header.

Thanks for putting this together!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google/cloud/bigquery/table.py Outdated
"partitioning_type": "timePartitioning",
"external_data_configuration": "externalDataConfiguration",
"friendly_name": "friendlyName",
"mv_enable_refresh": "materializedView",

@shollyman shollyman Dec 1, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can use a better prefix? For logical views we're already using view_ prefix, maybe mview or matview? My worry that mv is too terse here and/or people will overlook them in favor of the logical properties.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google/cloud/bigquery/table.py Outdated

@mv_query.deleter
def mv_query(self):
"""Delete SQL query defining the table as a view."""

@shollyman shollyman Dec 1, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: s/view/materialized view/ since we're dealing with multiple kinds now.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread samples/snippets/materialized_view.py Outdated


def alter_materialized_view(override_values={}):
# [START bigquery_alter_materialized_view]

@shollyman shollyman Dec 1, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tag makes me itchy, and expecting a DDL style ALTER MATERIALIZED VIEW statement rather than an api update call. Should we correct the tag?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tswast tswast Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, corrected to bigquery_update_materialized_view.

The corresponding docs section has room for both. https://cloud.google.com/bigquery/docs/materialized-views#alter For example the bq table shows bq query with DDL and bq update options.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread samples/snippets/materialized_view_test.py Outdated
@@ -0,0 +1,93 @@
# Copyright 2016 Google Inc. All Rights Reserved.

@shollyman shollyman Dec 1, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2020?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tswast added 3 commits December 1, 2020 17:01
@tswast
refactor: rename mv properties to mview
da2acf6
@tswast
docs: correct comment to refer to materialized view
145aec5
@tswast
docs: update region tag
ab66f8f
busunkim96
busunkim96 approved these changes Dec 2, 2020
View reviewed changes
tswast added 2 commits December 2, 2020 10:39
@tswast
Merge branch 'master' into b144499037-materialized-views
d3d765b
@tswast
Merge branch 'master' into b144499037-materialized-views
beded3a
@tswast tswast added the automerge Merge the pull request once unit tests and other checks pass. label Dec 3, 2020
@gcf-merge-on-green
gcf-merge-on-green Bot merged commit 57ffc66 into googleapis:master Dec 3, 2020
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Dec 3, 2020
@tswast
tswast deleted the b144499037-materialized-views branch December 3, 2020 15:45
@release-please release-please Bot mentioned this pull request Jan 4, 2022
chore(main): release python-bigquery 1.27.1 #1097
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@shollyman shollyman shollyman approved these changes
@busunkim96 busunkim96 busunkim96 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

support for materialized views

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@tswast @shollyman @busunkim96
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.