-
Is there any place where to find complete samples of how to use the BigQuery APIs? Let's assume I have my schema in JSON format and the data to be written to my BQ table, what I'm doing now:
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Probably the easiest thing is to have a protocol buffer with an equivalent schema, such as in this example (it is work in progress, it lacks testing, a good README, etc.): GoogleCloudPlatform/cpp-samples#211 If you need to do this dynamically, then it will probably get complicated really fast. The API requires uploading the data as serialized protos: So without an actual .proto file, you would need to dynamically create a descriptor for the proto. I have never done this, but the documentation suggests this is a starting point: |
Beta Was this translation helpful? Give feedback.
Probably the easiest thing is to have a protocol buffer with an equivalent schema, such as in this example (it is work in progress, it lacks testing, a good README, etc.):
GoogleCloudPlatform/cpp-samples#211
If you need to do this dynamically, then it will probably get complicated really fast. The API requires uploading the data as serialized protos:
https://github.com/googleapis/googleapis/blob/13d5b3f3f9412f38427c8ad48068f04ad1ee9808/google/cloud/bigquery/storage/v1/storage.proto#L420-L424
So without an act…