Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for materialized views #408

Merged

Conversation

tswast
Copy link
Contributor

@tswast tswast commented Dec 1, 2020

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 馃

@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
Copy link

snippet-bot bot commented Dec 1, 2020

Here is the summary of changes.

You added 6 region tags.

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

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Dec 1, 2020
Copy link
Contributor

@shollyman shollyman left a 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!

"partitioning_type": "timePartitioning",
"external_data_configuration": "externalDataConfiguration",
"friendly_name": "friendlyName",
"mv_enable_refresh": "materializedView",
Copy link
Contributor

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.


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

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.



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

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?

Copy link
Contributor Author

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.

@@ -0,0 +1,93 @@
# Copyright 2016 Google Inc. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

2020?

@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
9 checks passed
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support for materialized views
3 participants