Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
--Syntax (version 1.0)
--Unconditional sampling, single sample rate
select * from sample(
ON ...
SAMPLEFRACTION('fraction')
[Seed('seed')]
--Unconditional sampling, total approximate sample size
select * from sample (
ON ... as data PARTITION BY ANY
ON ... as summary DIMENSION
ApproximateSampleSize('size')
[Seed('seed')]
--conditional simple sampling, single sample rate
select * from sample (
ON ...
CONDITIONONCOLUMN('column')
CONDITIONON('cond1'[,'cond2',...])
SAMPLEFRACTION('fraction')
[SEED('seed')]
--Conditional sampling, variable sample rates
select * from sample (
ON ...
CONDITIONONCOLUMN('column')
CONDITIONON('cond1'[,'cond2',...])
SAMPLEFRACTION('f1'[,'f2','f3',...])
[SEED('seed')]
--Conditional sampling, total approximate sample size
select * from sample (
ON ... as data PARTITION BY ANY
ON ... as summary DIMENSION
CONDITIONONCOLUMN('column')
CONDITIONON('cond1'[,'cond2',...])
ApproximateSampleSize('total_sample_size')
[SEED('seed')]
--Conditional sampling, variable approximate sample sizes
select * from sample (
ON ... as data PARTITION BY ANY
ON ... as summary DIMENSION
CONDITIONONCOLUMN('column')
CONDITIONON('cond1'[,'cond2',...])
APPROXIMATESAMPLESIZE('s1'[,'s2',...])
[SEED('seed')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.