nerdexam
Snowflake

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…

Data Transformations

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)
  • A
    4% (1)
  • B
    91% (21)
  • C
    4% (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

#Snowflake SAMPLE clause#Non-deterministic sampling#SEED parameter#Query result consistency

Community Discussion

No community discussion yet for this question.

Full COF-C02 Practice