Package org.apache.calcite.sql
Class SqlSampleSpec
java.lang.Object
org.apache.calcite.sql.SqlSampleSpec
- Direct Known Subclasses:
SqlSampleSpec.SqlSubstitutionSampleSpec,SqlSampleSpec.SqlTableSampleSpec
Specification of a SQL sample.
For example, the query
SELECT *
FROM emp TABLESAMPLE SUBSTITUTE('medium')
declares a sample which is created using createNamed(java.lang.String).
A sample is not a SqlNode. To include it in a parse tree, wrap it
as a literal, viz:
SqlLiteral.createSample(SqlSampleSpec, org.apache.calcite.sql.parser.SqlParserPos).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSample specification that orders substitution.static classSample specification. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SqlSampleSpeccreateNamed(String name) Creates a sample which substitutes one relation for another.static SqlSampleSpeccreateTableSample(boolean isBernoulli, float sampleRate) Deprecated.static SqlSampleSpeccreateTableSample(boolean isBernoulli, float sampleRate, int repeatableSeed) Deprecated.static SqlSampleSpeccreateTableSample(boolean isBernoulli, BigDecimal sampleRate) Creates a table sample without repeatability.static SqlSampleSpeccreateTableSample(boolean isBernoulli, BigDecimal sampleRate, int repeatableSeed) Creates a table sample with repeatability.
-
Constructor Details
-
SqlSampleSpec
protected SqlSampleSpec()
-
-
Method Details
-
createNamed
Creates a sample which substitutes one relation for another. -
createTableSample
Creates a table sample without repeatability.- Parameters:
isBernoulli- true if Bernoulli style sampling is to be used; false for implementation specific samplingsampleRate- likelihood of a row appearing in the sample
-
createTableSample
Deprecated. -
createTableSample
public static SqlSampleSpec createTableSample(boolean isBernoulli, BigDecimal sampleRate, int repeatableSeed) Creates a table sample with repeatability.- Parameters:
isBernoulli- true if Bernoulli style sampling is to be used; false for implementation specific samplingsampleRate- likelihood of a row appearing in the samplerepeatableSeed- seed value used to reproduce the same sample
-
createTableSample
@Deprecated public static SqlSampleSpec createTableSample(boolean isBernoulli, float sampleRate, int repeatableSeed) Deprecated.
-