可能是由于导出的表格没有正确设置Schema信息所致。可以尝试在导出数据时,显式地为表格设置Schema。例如,以下代码使用Python语言从BigQuery视图导出数据到表格,并设置了Schema信息:
from google.cloud import bigquery
client = bigquery.Client()
view_id = "[PROJECT_ID].[DATASET_ID].[VIEW_ID]"
table_id = "[PROJECT_ID].[DATASET_ID].[TABLE_ID]"
# Define table schema
schema = [
bigquery.SchemaField("field1", "STRING"),
bigquery.SchemaField("field2", "INTEGER"),
bigquery.SchemaField("field3", "FLOAT"),
]
job_config = bigquery.QueryJobConfig(destination=table_id, schema=schema)
# Start query job to export data from view to table with schema
query = """
SELECT *
FROM `{}`""".format(view_id)
query_job = client.query(query, job_config=job_config)
# Wait for query job to finish
query_job.result()
print("Data exported from view to table with schema.")