Search in sources :

Example 1 with SampleNode

use of io.trino.sql.planner.plan.SampleNode in project trino by trinodb.

the class RelationPlanner method visitSampledRelation.

@Override
protected RelationPlan visitSampledRelation(SampledRelation node, Void context) {
    RelationPlan subPlan = process(node.getRelation(), context);
    double ratio = analysis.getSampleRatio(node);
    PlanNode planNode = new SampleNode(idAllocator.getNextId(), subPlan.getRoot(), ratio, SampleNode.Type.fromType(node.getType()));
    return new RelationPlan(planNode, analysis.getScope(node), subPlan.getFieldMappings(), outerContext);
}
Also used : PlanNode(io.trino.sql.planner.plan.PlanNode) SampleNode(io.trino.sql.planner.plan.SampleNode)

Aggregations

PlanNode (io.trino.sql.planner.plan.PlanNode)1 SampleNode (io.trino.sql.planner.plan.SampleNode)1