问题
What's the most efficient way to perform a batch insert in python using Google Bigquery Api. I was tryng to perform a stream row using this code on a large dataset (1 000 000 +) but it's taking a while to insert them. Is there a more efficient way to insert a large dataset in Python?
- The table already exists, and it has info.
- I have a list of 1 millon datapoints I want to insert
- I'd like to do it with Python, because I'll reuse the code many times.
回答1:
I don't think Streaming (Insert All API) makes sense in your case
You rather should try Load Job
See python code example in documentation
来源:https://stackoverflow.com/questions/39085925/batch-with-google-bigquery-and-python