Search in sources :

Example 1 with SampleNode

use of com.facebook.presto.sql.planner.plan.SampleNode in project presto by prestodb.

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(getSourceLocation(node), idAllocator.getNextId(), subPlan.getRoot(), ratio, SampleNodeUtil.fromType(node.getType()));
    return new RelationPlan(planNode, analysis.getScope(node), subPlan.getFieldMappings());
}
Also used : PlanNode(com.facebook.presto.spi.plan.PlanNode) SampleNode(com.facebook.presto.sql.planner.plan.SampleNode)

Aggregations

PlanNode (com.facebook.presto.spi.plan.PlanNode)1 SampleNode (com.facebook.presto.sql.planner.plan.SampleNode)1