Package com.facebook.presto.sql.planner

Examples of com.facebook.presto.sql.planner.Symbol


                    .addAll(node.getOrderBy());

            ImmutableMap.Builder<Symbol, Signature> functions = ImmutableMap.builder();
            ImmutableMap.Builder<Symbol, FunctionCall> functionCalls = ImmutableMap.builder();
            for (Map.Entry<Symbol, FunctionCall> entry : node.getWindowFunctions().entrySet()) {
                Symbol symbol = entry.getKey();

                if (expectedOutputs.contains(symbol)) {
                    FunctionCall call = entry.getValue();
                    expectedInputs.addAll(DependencyExtractor.extractUnique(call));
View Full Code Here


        {
            ImmutableSet.Builder<Symbol> expectedInputs = ImmutableSet.builder();

            ImmutableMap.Builder<Symbol, Expression> builder = ImmutableMap.builder();
            for (int i = 0; i < node.getOutputSymbols().size(); i++) {
                Symbol output = node.getOutputSymbols().get(i);
                Expression expression = node.getExpressions().get(i);

                if (expectedOutputs.contains(output)) {
                    expectedInputs.addAll(DependencyExtractor.extractUnique(expression));
                    builder.put(output, expression);
View Full Code Here

    private StageExecutionPlan createTableScanPlan(String planId, MetadataManager metadata, int splitCount)
    {
        TableHandle tableHandle = metadata.getTableHandle(SESSION, new QualifiedTableName("default", "default", DualMetadata.NAME)).get();
        ColumnHandle columnHandle = metadata.getColumnHandle(tableHandle, DualMetadata.COLUMN_NAME).get();
        Symbol symbol = new Symbol(DualMetadata.COLUMN_NAME);

        // table scan with splitCount splits
        PlanNodeId tableScanNodeId = new PlanNodeId(planId);
        PlanFragment testFragment = new PlanFragment(
                new PlanFragmentId(planId),
View Full Code Here

        TableHandle tableHandle = new TableHandle(DualConnector.CONNECTOR_ID, dualMetadata.getTableHandle(SESSION, new SchemaTableName("default", DualMetadata.NAME)));
        assertNotNull(tableHandle, "tableHandle is null");

        ColumnHandle columnHandle = new ColumnHandle(DualConnector.CONNECTOR_ID, dualMetadata.getColumnHandle(tableHandle.getConnectorHandle(), DualMetadata.COLUMN_NAME));
        assertNotNull(columnHandle, "columnHandle is null");
        Symbol symbol = new Symbol(DualMetadata.COLUMN_NAME);

        MetadataManager metadata = new MetadataManager(new FeaturesConfig(), new TypeRegistry());
        metadata.addGlobalSchemaMetadata(DualConnector.CONNECTOR_ID, dualMetadata);

        DualSplitManager dualSplitManager = new DualSplitManager(new InMemoryNodeManager());
View Full Code Here

                        boolean alignedComparison = Iterables.all(DependencyExtractor.extractUnique(equality.getLeft()), in(node.getLeft().getOutputSymbols()));
                        Expression leftExpression = (alignedComparison) ? equality.getLeft() : equality.getRight();
                        Expression rightExpression = (alignedComparison) ? equality.getRight() : equality.getLeft();

                        Symbol leftSymbol = symbolAllocator.newSymbol(leftExpression, extractType(leftExpression));
                        leftProjections.put(leftSymbol, leftExpression);
                        Symbol rightSymbol = symbolAllocator.newSymbol(rightExpression, extractType(rightExpression));
                        rightProjections.put(rightSymbol, rightExpression);

                        builder.add(new JoinNode.EquiJoinClause(leftSymbol, rightSymbol));
                    }
View Full Code Here

        );
    }

    private StageExecutionPlan createTableScanPlan(String planId, int splitCount)
    {
        Symbol symbol = new Symbol("column");

        // table scan with splitCount splits
        PlanNodeId tableScanNodeId = new PlanNodeId(planId);
        PlanFragment testFragment = new PlanFragment(
                new PlanFragmentId(planId),
View Full Code Here

    @BeforeMethod
    public void setUp()
            throws Exception
    {
        Symbol symbol = new Symbol("column");

        MetadataManager metadata = new MetadataManager(new FeaturesConfig(), new TypeRegistry());

        DataStreamManager dataStreamProvider = new DataStreamManager();
        dataStreamProvider.addConnectorDataStreamProvider("test", new TestingDataStreamProvider());
View Full Code Here

    @BeforeMethod
    public void setUp()
            throws Exception
    {
        Symbol symbol = new Symbol("column");

        MetadataManager metadata = new MetadataManager(new FeaturesConfig(), new TypeRegistry());

        LocalExecutionPlanner planner = new LocalExecutionPlanner(
                new NodeInfo("test"),
View Full Code Here

        final Map<ConnectorColumnHandle, Object> bindings = new HashMap<>();
        for (ComparisonExpression comparison : comparisons) {
            // Record binding if condition is an equality comparison over a partition key
            QualifiedNameReference reference = extractReference(comparison);
            Symbol symbol = Symbol.fromQualifiedName(reference.getName());

            ConnectorColumnHandle column = symbolToColumnName.get(symbol);
            if (column != null) {
                Literal literal = extractLiteral(comparison);
View Full Code Here

        @Override
        public PlanNode rewriteProject(ProjectNode node, Void context, PlanRewriter<Void> planRewriter)
        {
            PlanNode source = planRewriter.rewrite(node.getSource(), null);
            if (source instanceof MaterializeSampleNode && Iterables.all(node.getExpressions(), DeterminismEvaluator.deterministic())) {
                Symbol sampleWeightSymbol = ((MaterializeSampleNode) source).getSampleWeightSymbol();
                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 {
View Full Code Here

TOP

Related Classes of com.facebook.presto.sql.planner.Symbol

Copyright © 2018 www.massapicom. 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.