COF-C02 · Question #616
What would cause different results to be returned when running the same query twice?
The correct answer is B. sample is used and the seed is not set. When using the SAMPLE clause in a query, if the seed is not set, Snowflake will use a different random seed for each execution of the query. This results in different rows being sampled each time, leading to different results. Setting a seed ensures that the same rows are…
Question
What would cause different results to be returned when running the same query twice?
Options
- ASAMPLE is used and the seed is set
- Bsample is used and the seed is not set.
- CFraction-based sampling is used.
- DFixed-size sampling Is used.
How the community answered
(23 responses)- A4% (1)
- B91% (21)
- C4% (1)
Explanation
When using the SAMPLE clause in a query, if the seed is not set, Snowflake will use a different random seed for each execution of the query. This results in different rows being sampled each time, leading to different results. Setting a seed ensures that the same rows are sampled each time the query is run.
Topics
Community Discussion
No community discussion yet for this question.