Package org.apache.calcite.plan
Class RelOptSamplingParameters
java.lang.Object
org.apache.calcite.plan.RelOptSamplingParameters
RelOptSamplingParameters represents the parameters necessary to produce a
sample of a relation.
Its parameters are derived from the SQL 2003 TABLESAMPLE clause.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRelOptSamplingParameters
(boolean bernoulli, float sampleRate, boolean isRepeatable, int repeatableSeed) Deprecated.RelOptSamplingParameters
(boolean bernoulli, BigDecimal sampleRate, boolean repeatable, int repeatableSeed) -
Method Summary
Modifier and TypeMethodDescriptionint
IfisRepeatable()
returnstrue
, this method returns a user-specified seed value.float
Deprecated.boolean
Indicates whether Bernoulli or system sampling should be performed.boolean
Indicates whether the sample results should be repeatable.
-
Field Details
-
sampleRate
-
-
Constructor Details
-
RelOptSamplingParameters
public RelOptSamplingParameters(boolean bernoulli, BigDecimal sampleRate, boolean repeatable, int repeatableSeed) -
RelOptSamplingParameters
@Deprecated public RelOptSamplingParameters(boolean bernoulli, float sampleRate, boolean isRepeatable, int repeatableSeed) Deprecated.
-
-
Method Details
-
isBernoulli
public boolean isBernoulli()Indicates whether Bernoulli or system sampling should be performed. Bernoulli sampling requires the decision whether to include each row in the sample to be independent across rows. System sampling allows implementation-dependent behavior.- Returns:
- true if Bernoulli sampling is configured, false for system sampling
-
getSamplingPercentage
Deprecated.Returns the sampling percentage. For Bernoulli sampling, the sampling percentage is the likelihood that any given row will be included in the sample. For system sampling, the sampling percentage indicates (roughly) what percentage of the rows will appear in the sample.- Returns:
- the sampling percentage between 0.0 and 1.0, exclusive
-
isRepeatable
public boolean isRepeatable()Indicates whether the sample results should be repeatable. Sample results are only required to repeat if no changes have been made to the relation's content or structure. If the sample is configured to be repeatable, then a user-specified seed value can be obtained viagetRepeatableSeed()
.- Returns:
- true if the sample results should be repeatable
-
getRepeatableSeed
public int getRepeatableSeed()IfisRepeatable()
returnstrue
, this method returns a user-specified seed value. Samples of the same, unmodified relation should be identical if the sampling mode, sampling percentage and repeatable seed are the same.- Returns:
- seed value for repeatable samples
-