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
Closed

support for materialized views #407

tswast opened this issue Dec 1, 2020 · 1 comment

Comments

@tswast
Copy link
Contributor

@tswast tswast commented Dec 1, 2020

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

@tswast
Copy link
Contributor Author

@tswast 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"
  }
}

Loading

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant