フリー問題

SnowPro Advanced: Data Scientist のフリー問題 20 / 20 問目

問題文

A Python function scores rows one at a time and is called on 300 million rows. The per-call overhead dominates the runtime. Which change addresses this?

選択肢

  1. Move the scoring to an external function, because a remote service can process the rows faster than the warehouse.
  2. Convert it to a stored procedure that loops over the rows, because a loop inside a single call pays the fixed cost only once and therefore removes the per-row overhead completely, no matter how many rows the loop has to visit.
  3. Increase the warehouse size, because the per-call overhead that the runtime shows on tables of hundreds of millions of rows is a memory constraint that a larger warehouse removes.
  4. Rewrite it as a function that receives a batch of rows as a dataframe and returns a series of results, so the fixed cost is paid once per batch instead of once per row.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。