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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for materialized views #407

Closed
tswast opened this issue Dec 1, 2020 · 1 comment · Fixed by #408
Closed

support for materialized views #407

tswast opened this issue Dec 1, 2020 · 1 comment · Fixed by #408
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@tswast
Copy link
Contributor

tswast commented Dec 1, 2020

Another table type: https://cloud.google.com/bigquery/docs/materialized-views-intro

@tswast tswast added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Dec 1, 2020
@tswast tswast self-assigned this Dec 1, 2020
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Dec 1, 2020
@tswast
Copy link
Contributor Author

tswast commented Dec 1, 2020

Test resource for reference:

{
  "kind": "bigquery#table",
  "etag": "7Ct2d8SG3CQbHnRXL1OAhw==",
  "id": "swast-scratch:my_dataset.tx_names",
  "selfLink": "https://content-bigquery.googleapis.com/bigquery/v2/projects/swast-scratch/datasets/my_dataset/tables/tx_names",
  "tableReference": {
    "projectId": "swast-scratch",
    "datasetId": "my_dataset",
    "tableId": "tx_names"
  },
  "schema": {
    "fields": [
      {
        "name": "total",
        "type": "INTEGER"
      },
      {
        "name": "state",
        "type": "STRING"
      },
      {
        "name": "gender",
        "type": "STRING"
      },
      {
        "name": "year",
        "type": "INTEGER"
      },
      {
        "name": "name",
        "type": "STRING"
      }
    ]
  },
  "numBytes": "11045428",
  "numLongTermBytes": "0",
  "numRows": "356150",
  "creationTime": "1606751841803",
  "lastModifiedTime": "1606751852031",
  "type": "MATERIALIZED_VIEW",
  "location": "US",
  "materializedView": {
    "query": "SELECT SUM(number) AS total, state, gender, year, name\nFROM swast-scratch.my_dataset.usa_names\nWHERE state = 'TX'\nGROUP BY state, gender, year, name",
    "lastRefreshTime": "1606751842496",
    "enableRefresh": true,
    "refreshIntervalMs": "1800000"
  }
}

gcf-merge-on-green bot pushed a commit that referenced this issue Dec 3, 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:
- [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-bigquery/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)

Fixes #407 🦕
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. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant