Class RelOptSamplingParameters

java.lang.Object
org.apache.calcite.plan.RelOptSamplingParameters

public class RelOptSamplingParameters extends Object
RelOptSamplingParameters represents the parameters necessary to produce a sample of a relation.

Its parameters are derived from the SQL 2003 TABLESAMPLE clause.

  • Field Details

  • 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 public float 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 via getRepeatableSeed().
      Returns:
      true if the sample results should be repeatable
    • getRepeatableSeed

      public int getRepeatableSeed()
      If isRepeatable() returns true, 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