if (node.getType() == SampledRelation.Type.POISSONIZED) {
sampleWeightSymbol = symbolAllocator.newSymbol("$sampleWeight", BigintType.BIGINT);
}
PlanNode planNode = new SampleNode(idAllocator.getNextId(), subPlan.getRoot(), ratio, SampleNode.Type.fromType(node.getType()), node.isRescaled(), Optional.fromNullable(sampleWeightSymbol));
if (sampleWeightSymbol != null) {
planNode = new MaterializeSampleNode(idAllocator.getNextId(), planNode, sampleWeightSymbol);
}
return new RelationPlan(planNode, outputDescriptor, subPlan.getOutputSymbols());
}