google-bigquery - Bigquery - 在视图类型的表上浏览表数据
问题描述
我想使用 BigQuery 的预览/头部功能免费查看表的示例数据,如此处所述,为此我尝试使用此处列出的python api
from google.cloud import bigquery
# Construct a BigQuery client object.
client = bigquery.Client()
# TODO(developer): Set table_id to the ID of the table to browse data rows.
# table_id = "your-project.your_dataset.your_table_name"
# Download all rows from a table.
rows_iter = client.list_rows(table_id) # Make an API request.
# Iterate over rows to make the API requests to fetch row data.
rows = list(rows_iter)
这导致:
BadRequest: 400 GET https://bigquery.googleapis.com/bigquery/v2/projects/your-project/datasets/your_dataset/tables/your_table_name/data?formatOptions.useInt64Timestamp=True&prettyPrint=false: Cannot list a table of type VIEW.
有没有办法预览类型视图的表格?
还有其他免费的选择吗?
解决方案
我假设您可以将视图的内容写入临时表并链接到该临时表。这不是我同意的最干净的解决方案。
博士
推荐阅读
- python - 如何在 Google Collab 中安装 HyperOpt-Sklearn 库?
- sql - 在同一个数据库sql server中使用一些过滤器将值从一个表A复制到表B
- php - PHP使用XPATH从HTML页面获取文本和Href
- c - C中的指针和“非法指令(核心转储)”
- node.js - 无法从我的前端使用 axios 发送表单数据。出现网络错误。但是当我试图从邮递员那里打后端时,它工作正常
- r - 在 Shiny 的 pickerInput 中将答案下拉框移到右侧
- python - 人脸检测项目报错如何解决
- c# - 在 WPF 中获取十六进制颜色代码时出错
- python - 查找字长
- asp.net - ASP.NET MVC - IIS Express(谷歌浏览器)