Examples of ProjectNode


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

                if (!assignments.containsKey(canonical)) {
                    assignments.put(canonical, expression);
                }
            }

            return new ProjectNode(node.getId(), source, assignments);
        }
View Full Code Here

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

        {
            PlanNode source = planRewriter.rewrite(node.getSource(), context);

            if (node.getOutputSymbols().size() != source.getOutputSymbols().size()) {
                // Can't get rid of this projection. It constrains the output tuple from the underlying operator
                return new ProjectNode(node.getId(), source, node.getOutputMap());
            }

            boolean canElide = true;
            for (Map.Entry<Symbol, Expression> entry : node.getOutputMap().entrySet()) {
                Expression expression = entry.getValue();
                Symbol symbol = entry.getKey();
                if (!(expression instanceof QualifiedNameReference && ((QualifiedNameReference) expression).getName().equals(symbol.toQualifiedName()))) {
                    canElide = false;
                    break;
                }
            }

            if (canElide) {
                return source;
            }

            return new ProjectNode(node.getId(), source, node.getOutputMap());
        }
View Full Code Here

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

            Expression expression = node.getOutputMap().get(sampleWeightSymbol);
            if (expression instanceof QualifiedNameReference) {
                Symbol unaliasedSampleWeightSymbol = Symbol.fromQualifiedName(((QualifiedNameReference) expression).getName());
                context = new LimitContext(context.getCount(), Optional.of(unaliasedSampleWeightSymbol));
                PlanNode source = planRewriter.rewrite(node.getSource(), context);
                return new ProjectNode(node.getId(), source, node.getOutputMap());
            }
            else {
                // TODO: We might want to add another limit here that ignores sample weight, and push it down. We would have to assume that sample weight is never zero.
                PlanNode rewrittenNode = planRewriter.defaultRewrite(node, null);
                // Drop in a LimitNode b/c we cannot push our limit down any further
View Full Code Here

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

                }
            }

            PlanNode source = planRewriter.rewrite(node.getSource(), expectedInputs.build());

            return new ProjectNode(node.getId(), source, builder.build());
        }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.gui.configuration.tree.nodes.ProjectNode

        "</cruisecontrol>",
        "Proj1",
        "Proj2");
    TreeModel model = tree.getModel();
    RootNode root = (RootNode) model.getRoot();
    ProjectNode proj = (ProjectNode) root.getChildAt(0);
    this.testNode = (BasicNode) proj.getChildAt(0);
  }
View Full Code Here

Examples of org.cfeclipse.cfml.views.packageview.objects.ProjectNode

       
       
        for(int i = 0; i < projects.length; i++)
        {
          if(projects[i].isOpen())
            invisibleRoot.addChild( new ProjectNode(projects[i]) );
//        try {
//          IProjectNature nature = projects[i].getNature("org.cfeclipse.cfml.natures.CFENature");
//         
//          if(nature != null){
//            
View Full Code Here

Examples of org.jitterbit.integration.uidelegate.project.ProjectNode

        super(IntegrationProject.class);
    }

    @Override
    protected IntegrationEntityTreeNode createNode(IntegrationProject project) {
        return new ProjectNode(project);
    }
View Full Code Here

Examples of org.teiid.query.processor.relational.ProjectNode

        switch(accessNodes.size()) {
            case 0:
            {
                if (RelationalNodeUtil.isUpdate(accessNode.getCommand())) {
                  //should return a 0 update count
                  ProjectNode pnode = new ProjectNode(getID());
                  pnode.setElements(accessNode.getElements());
                  pnode.setSelectSymbols(Arrays.asList(new ExpressionSymbol("x", new Constant(0)))); //$NON-NLS-1$
                  return pnode;
                }
                // Replace existing access node with a NullNode
                NullNode nullNode = new NullNode(getID());
                nullNode.setElements(accessNode.getElements());
                return nullNode;        
            }
            case 1:
            {
                // Replace existing access node with new access node (simplified command)
                AccessNode newNode = accessNodes.get(0);
                return newNode;                                               
            }
            default:
            {
              multiSource = true;
              UnionAllNode unionNode = new UnionAllNode(getID());
              unionNode.setElements(accessNode.getElements());
               
                for (AccessNode newNode : accessNodes) {
                  unionNode.addChild(newNode);
                }
             
              RelationalNode parent = unionNode;
             
                // More than 1 access node - replace with a union
              if (RelationalNodeUtil.isUpdate(accessNode.getCommand())) {
                update = true;
                GroupingNode groupNode = new GroupingNode(getID());                   
                AggregateSymbol sumCount = new AggregateSymbol("SumCount", NonReserved.SUM, false, (Expression)accessNode.getElements().get(0)); //$NON-NLS-1$             
                List<Expression> outputElements = new ArrayList<Expression>(1);               
                outputElements.add(sumCount);
                groupNode.setElements(outputElements);
                groupNode.addChild(unionNode);
               
                ProjectNode projectNode = new ProjectNode(getID());
               
                Expression intSum = ResolverUtil.getConversion(sumCount, DataTypeManager.getDataTypeName(sumCount.getType()), DataTypeManager.DefaultDataTypes.INTEGER, false, metadata.getFunctionLibrary());
               
                Expression rowCount = new ExpressionSymbol("RowCount", intSum); //$NON-NLS-1$               
                outputElements = new ArrayList<Expression>(1);               
                outputElements.add(rowCount);                
                projectNode.setElements(outputElements);
                projectNode.setSelectSymbols(outputElements);
                projectNode.addChild(groupNode);
               
                parent = projectNode;
              }
                return parent;
            }
View Full Code Here

Examples of org.teiid.query.processor.relational.ProjectNode

      helpPutPreparedPlans(cache, token2, 0, 15);
     
      //read an entry for session2 (token2)
      PreparedPlan pPlan = cache.get(new CacheID(token2, pi, EXAMPLE_QUERY + 12));
      assertNotNull("Unable to get prepared plan from cache", pPlan); //$NON-NLS-1$
      assertEquals("Error getting plan from cache", new RelationalPlan(new ProjectNode(12)).toString(), pPlan.getPlan().toString()); //$NON-NLS-1$
      assertEquals("Error getting command from cache", EXAMPLE_QUERY + 12, pPlan.getCommand().toString()); //$NON-NLS-1$
      assertNotNull("Error getting plan description from cache", pPlan.getAnalysisRecord()); //$NON-NLS-1$
      assertEquals("Error gettting reference from cache", new Reference(1), pPlan.getReferences().get(0)); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.teiid.query.processor.relational.ProjectNode

        CacheID id = new CacheID(session, pi, dummy.toString());

        PreparedPlan pPlan = new PreparedPlan();
        cache.put(id, Determinism.SESSION_DETERMINISTIC, pPlan, null);
        pPlan.setCommand(dummy);
        pPlan.setPlan(new RelationalPlan(new ProjectNode(i)), new CommandContext());
            AnalysisRecord analysisRecord = new AnalysisRecord(true, false);
        pPlan.setAnalysisRecord(analysisRecord);
        ArrayList<Reference> refs = new ArrayList<Reference>();
        refs.add(new Reference(1));
        pPlan.setReferences(refs);
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.