我正在尝试使用Python通过BigQuery API连接到Google BigQuery.
我在此处关注此页:https: //cloud.google.com/bigquery/bigquery-api-quickstart
我的代码如下:
import os
import argparse
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client.client import GoogleCredentials
GOOGLE_APPLICATION_CREDENTIALS = './Peepl-cb1dac99bdc0.json'
def main(project_id):
# Grab the application's default credentials from the environment.
credentials = GoogleCredentials.get_application_default()
print(credentials)
# Construct the service object for interacting with the BigQuery API.
bigquery_service = build('bigquery', 'v2', credentials=credentials)
try:
query_request = bigquery_service.jobs()
query_data = {
'query': (
'SELECT TOP(corpus, 10) as title, '
'COUNT(*) as unique_words '
'FROM [publicdata:samples.shakespeare];')
} …Run Code Online (Sandbox Code Playgroud) 我正在尝试运行查询" select*from tablename ".但它会抛出错误,如" 错误:响应太大而无法返回 ".
我能够处理包含TB数据的其他表.但我得到包含294 MB的表的此错误.
我能够通过选择列名来选择表,但有一些限制无法处理select查询中的所有列.在我的选择查询中,我有26列,但我能够选择16列而不会出错." 从tablename中选择column1,column2,column3,.... column16 ".
是否与表的列和大小有任何关系.
请帮我解决这个问题.
大查询表详细信息:
总记录:683,038
表大小:294 MB
专栏:26