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 review from as code owners Dec 1, 2020
@tswast tswast requested a review from shollyman Dec 1, 2020
@google-cla google-cla bot added the cla: yes label Dec 1, 2020
@snippet-bot
Copy link

@snippet-bot 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

Loading

Copy link
Contributor

@shollyman shollyman left a comment

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

Thanks for putting this together!

Loading

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

@shollyman shollyman Dec 1, 2020

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.

Loading


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

@shollyman shollyman Dec 1, 2020

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.

Loading



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

@shollyman shollyman Dec 1, 2020

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?

Loading

Copy link
Contributor Author

@tswast tswast Dec 1, 2020

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.

Loading

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

@shollyman shollyman Dec 1, 2020

Choose a reason for hiding this comment

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

2020?

Loading

@gcf-merge-on-green gcf-merge-on-green bot merged commit 57ffc66 into googleapis:master Dec 3, 2020
11 checks passed
Loading
@tswast tswast deleted the b144499037-materialized-views branch Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants