如何在Bigquery Python API中使用projection_fields参数
我正在尝试使用pythonapi将googlecloudstorage中的cloudfirestore导出加载到Bigquery中。我只需要加载我想要使用的几个字段--projection\u fields参数。但是,我无法在代码中成功使用此参数。我指的是这个医生: 我正在使用google.cloud库 在bigquery或firestore库中找不到此字段 关于如何使用pythonapi使用此字段的任何提示都将非常有用如何在Bigquery Python API中使用projection_fields参数,python,google-cloud-firestore,google-bigquery,Python,Google Cloud Firestore,Google Bigquery,我正在尝试使用pythonapi将googlecloudstorage中的cloudfirestore导出加载到Bigquery中。我只需要加载我想要使用的几个字段--projection\u fields参数。但是,我无法在代码中成功使用此参数。我指的是这个医生: 我正在使用google.cloud库 在bigquery或firestore库中找不到此字段 关于如何使用pythonapi使用此字段的任何提示都将非常有用 import os from google.cloud import bi
import os
from google.cloud import bigquery
creds_file_path = "xxxx.json"
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = creds_file_path
bigquery_client = bigquery.Client()
dataset_ref = bigquery_client.dataset('abcd')
job_config = bigquery.LoadJobConfig()
job_config.write_disposition = bigquery.WriteDisposition.WRITE_TRUNCATE
job_config.source_format = bigquery.SourceFormat.DATASTORE_BACKUP
查看pyhon客户端库,似乎还不支持此选项。但是,您可以使用此解决方法包括ProjectOnFields属性,以及任何客户端尚不支持但适用于API的属性
my_list_of_properties = [] # The properties you want to include on the table
job_config._set_sub_prop('projectionFields', my_list_of_properties)