Examples of MaterializeSampleNode


Examples of com.facebook.presto.sql.planner.plan.MaterializeSampleNode

                Map<Symbol, Expression> outputMap = ImmutableMap.<Symbol, Expression>builder()
                        .putAll(node.getOutputMap())
                        .put(sampleWeightSymbol, new QualifiedNameReference(sampleWeightSymbol.toQualifiedName()))
                        .build();
                ProjectNode projectNode = new ProjectNode(node.getId(), ((MaterializeSampleNode) source).getSource(), outputMap);
                return new MaterializeSampleNode(source.getId(), projectNode, sampleWeightSymbol);
            }
            else {
                return planRewriter.defaultRewrite(node, null);
            }
        }
View Full Code Here

Examples of com.facebook.presto.sql.planner.plan.MaterializeSampleNode

        public PlanNode rewriteTopN(TopNNode node, Void context, PlanRewriter<Void> planRewriter)
        {
            PlanNode source = planRewriter.rewrite(node.getSource(), null);
            if (source instanceof MaterializeSampleNode) {
                node = new TopNNode(node.getId(), ((MaterializeSampleNode) source).getSource(), node.getCount(), node.getOrderBy(), node.getOrderings(), node.isPartial(), Optional.of(((MaterializeSampleNode) source).getSampleWeightSymbol()));
                return new MaterializeSampleNode(source.getId(), node, ((MaterializeSampleNode) source).getSampleWeightSymbol());
            }
            else {
                return planRewriter.defaultRewrite(node, null);
            }
        }
View Full Code Here

Examples of com.facebook.presto.sql.planner.plan.MaterializeSampleNode

        public PlanNode rewriteSort(SortNode node, Void context, PlanRewriter<Void> planRewriter)
        {
            PlanNode source = planRewriter.rewrite(node.getSource(), null);
            if (source instanceof MaterializeSampleNode) {
                node = new SortNode(node.getId(), ((MaterializeSampleNode) source).getSource(), node.getOrderBy(), node.getOrderings());
                return new MaterializeSampleNode(source.getId(), node, ((MaterializeSampleNode) source).getSampleWeightSymbol());
            }
            else {
                return planRewriter.defaultRewrite(node, null);
            }
        }
View Full Code Here

Examples of com.facebook.presto.sql.planner.plan.MaterializeSampleNode

        public PlanNode rewriteLimit(LimitNode node, Void context, PlanRewriter<Void> planRewriter)
        {
            PlanNode source = planRewriter.rewrite(node.getSource(), null);
            if (source instanceof MaterializeSampleNode) {
                node = new LimitNode(node.getId(), ((MaterializeSampleNode) source).getSource(), node.getCount(), Optional.of(((MaterializeSampleNode) source).getSampleWeightSymbol()));
                return new MaterializeSampleNode(source.getId(), node, ((MaterializeSampleNode) source).getSampleWeightSymbol());
            }
            else {
                return planRewriter.defaultRewrite(node, null);
            }
        }
View Full Code Here

Examples of com.facebook.presto.sql.planner.plan.MaterializeSampleNode

        public PlanNode rewriteMarkDistinct(MarkDistinctNode node, Void context, PlanRewriter<Void> planRewriter)
        {
            PlanNode source = planRewriter.rewrite(node.getSource(), null);
            if (source instanceof MaterializeSampleNode) {
                node = new MarkDistinctNode(node.getId(), ((MaterializeSampleNode) source).getSource(), node.getMarkerSymbol(), node.getDistinctSymbols(), Optional.of(((MaterializeSampleNode) source).getSampleWeightSymbol()));
                return new MaterializeSampleNode(source.getId(), node, ((MaterializeSampleNode) source).getSampleWeightSymbol());
            }
            else {
                return planRewriter.defaultRewrite(node, null);
            }
        }
View Full Code Here

Examples of com.facebook.presto.sql.planner.plan.MaterializeSampleNode

                filteringSource = ((MaterializeSampleNode) filteringSource).getSource();
            }

            if (source instanceof MaterializeSampleNode) {
                node = new SemiJoinNode(node.getId(), ((MaterializeSampleNode) source).getSource(), filteringSource, node.getSourceJoinSymbol(), node.getFilteringSourceJoinSymbol(), node.getSemiJoinOutput());
                return new MaterializeSampleNode(source.getId(), node, ((MaterializeSampleNode) source).getSampleWeightSymbol());
            }
            else {
                return new SemiJoinNode(node.getId(), source, filteringSource, node.getSourceJoinSymbol(), node.getFilteringSourceJoinSymbol(), node.getSemiJoinOutput());
            }
        }
View Full Code Here

Examples of com.facebook.presto.sql.planner.plan.MaterializeSampleNode

                        outputSampleWeight = symbolAllocator.newSymbol(sampleWeightExpr, Type.BIGINT);
                        projections.put(outputSampleWeight, sampleWeightExpr);
                        joinNode = new ProjectNode(idAllocator.getNextId(), joinNode, projections.build());
                    }
                }
                return new MaterializeSampleNode(idAllocator.getNextId(), joinNode, outputSampleWeight);
            }

            return new JoinNode(node.getId(), node.getType(), leftSource, rightSource, node.getCriteria());
        }
View Full Code Here

Examples of com.facebook.presto.sql.planner.plan.MaterializeSampleNode

                    sources.add(addSampleWeight(source, symbol));
                }
            }

            node = new UnionNode(node.getId(), sources.build(), symbolMapping.build());
            return new MaterializeSampleNode(idAllocator.getNextId(), node, outputSymbol);
        }
View Full Code Here

Examples of com.facebook.presto.sql.planner.plan.MaterializeSampleNode

        @Override
        public PlanNode rewriteMaterializeSample(MaterializeSampleNode node, Void context, PlanRewriter<Void> planRewriter)
        {
            PlanNode source = planRewriter.rewrite(node.getSource(), context);
            return new MaterializeSampleNode(node.getId(), source, canonicalize(node.getSampleWeightSymbol()));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.