Class SampleToFilterRule

All Implemented Interfaces:
TransformationRule

@Enclosing public class SampleToFilterRule extends RelRule<SampleToFilterRule.Config> implements TransformationRule
This rule rewrite Sample which is bernoulli to the Filter.

For example:


    select deptno from "scott".dept tablesample bernoulli(50);
 

will convert to:


    select deptno from "scott".dept where rand() < 0.5;
 

The sql:


    select deptno from "scott".dept tablesample bernoulli(50) REPEATABLE(10);
 

will convert to:


    select deptno from "scott".dept where rand(10) < 0.5;
 
See Also: