我正在尝试用pythonapi读取Bigquery中表的选定字段。你知道吗
这是我的密码:
rows = bigquery_client.list_rows(table_ref,
selected_fields=[bigquery.SchemaField('id', 'INTEGER'),
bigquery.SchemaField('name', 'STRING'),
bigquery.SchemaField('short_name', 'STRING'),
bigquery.SchemaField('subdomain', 'STRING'),
bigquery.SchemaField('address', 'STRING'),
bigquery.SchemaField('address2', 'STRING'),
bigquery.SchemaField('department', 'STRING'),
bigquery.SchemaField('city', 'STRING'),
bigquery.SchemaField('state', 'STRING'),
bigquery.SchemaField('zip', 'STRING')])
for row in rows: # API request
print(row)
我得到一个错误:
ValueError: time data 'dummy' does not match format '%Y-%m-%dT%H:%M:%S'
这个伪值来自标记为String的subdomain字段,所以我不明白为什么Bigquery将其解析为DateTime。我已经检查了表是否创建良好,所以这不是问题所在。你知道吗
有什么帮助吗?你知道吗
我用这个解决了这个问题:
相关问题 更多 >
编程相关推荐