Topic 1 Question 13
Your teammate has asked you to review the code below. Its purpose is to efficiently add a large number of small rows to a BigQuery table.
Which improvement should you suggest your teammate make?Include multiple rows with each request.
Perform the inserts in parallel by creating multiple threads.
Write each row to a Cloud Storage object, then load into BigQuery.
Write each row to a Cloud Storage object in parallel, then load into BigQuery.
ユーザの投票
コメント(17)
For me the correct answer is A. Infact the loop build a single InsertReqeust and send it. But we can build all request in a list and use InsertAllRequest.newBuilder(tableId).setRows(rows).build() to send. https://cloud.google.com/bigquery/streaming-data-into-bigquery#streaminginsertexamples
👍 22fraloca2020/12/14- 正解だと思う選択肢: B
Response should be A, because original code pushes one row at a time, which is more time consuming in contrast to batch processing.
Proposed answer C is incorrect, because we still have more overhead in sending each row in separate request than using batch processing.
👍 6TrueCurry2021/12/22 - 正解だと思う選択肢: B
B is correct
👍 2tomato1232022/08/19
シャッフルモード