Package com.facebook.presto.sql.planner.plan

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


        {
            Expression originalConstraint = null;
            if (node.getOriginalConstraint() != null) {
                originalConstraint = simplifyExpression(node.getOriginalConstraint());
            }
            return new TableScanNode(node.getId(), node.getTable(), node.getOutputSymbols(), node.getAssignments(), originalConstraint, node.getSummarizedPartition());
        }
View Full Code Here


            Expression originalConstraint = null;
            if (node.getOriginalConstraint() != null) {
                originalConstraint = canonicalize(node.getOriginalConstraint());
            }
            return new TableScanNode(node.getId(), node.getTable(), canonicalize(node.getOutputSymbols()), builder.build(), originalConstraint, node.getSummarizedPartition());
        }
View Full Code Here

                Set<Symbol> requiredPartitionDomainSymbols = Maps.filterValues(node.getAssignments(), Predicates.in(node.getPartitionsDomainSummary().getDomains().keySet())).keySet();
                requiredAssignmentSymbols = Sets.union(requiredTableScanOutputs, requiredPartitionDomainSymbols);
            }
            Map<Symbol, ColumnHandle> newAssignments = Maps.filterKeys(node.getAssignments(), in(requiredAssignmentSymbols));

            return new TableScanNode(node.getId(), node.getTable(), newOutputSymbols, newAssignments, node.getOriginalConstraint(), node.getSummarizedPartition());
        }
View Full Code Here

            PlanNode output = node;
            if (!node.getGeneratedPartitions().equals(Optional.of(generatedPartitions))) {
                // Only overwrite the originalConstraint if it was previously null
                Expression originalConstraint = node.getOriginalConstraint() == null ? inheritedPredicate : node.getOriginalConstraint();
                output = new TableScanNode(node.getId(), node.getTable(), node.getOutputSymbols(), node.getAssignments(), originalConstraint, Optional.of(generatedPartitions));
            }
            if (!postScanPredicate.equals(BooleanLiteral.TRUE_LITERAL)) {
                output = new FilterNode(idAllocator.getNextId(), output, postScanPredicate);
            }
            return output;
View Full Code Here

        {
            Expression originalConstraint = null;
            if (node.getOriginalConstraint() != null) {
                originalConstraint = canonicalizeExpression(node.getOriginalConstraint());
            }
            return new TableScanNode(node.getId(), node.getTable(), node.getOutputSymbols(), node.getAssignments(), originalConstraint, node.getGeneratedPartitions());
        }
View Full Code Here

        // generate sources
        List<TaskSource> sources = new ArrayList<>();
        long sequenceId = 0;
        for (PlanNode sourceNode : subplan.getFragment().getSources()) {
            TableScanNode tableScan = (TableScanNode) sourceNode;

            DataSource dataSource = splitManager.getSplits(session,
                    tableScan.getTable(),
                    tableScan.getPartitionPredicate(),
                    tableScan.getUpstreamPredicateHint(),
                    Predicates.<Partition>alwaysTrue(),
                    tableScan.getAssignments());

            ImmutableSet.Builder<ScheduledSplit> scheduledSplits = ImmutableSet.builder();
            for (Split split : dataSource.getSplits()) {
                scheduledSplits.add(new ScheduledSplit(sequenceId++, split));
            }

            sources.add(new TaskSource(tableScan.getId(), scheduledSplits.build(), true));
        }

        // create drivers
        List<Driver> drivers = new ArrayList<>();
        Map<PlanNodeId, Driver> driversBySource = new HashMap<>();
View Full Code Here

        Split split = new DualSplit(HostAddress.fromString("127.0.0.1"));
        PlanNodeId tableScanNodeId = new PlanNodeId(planId);
        PlanFragment testFragment = new PlanFragment(new PlanFragmentId(planId),
                tableScanNodeId,
                ImmutableMap.<Symbol, Type>of(symbol, Type.VARCHAR),
                new TableScanNode(tableScanNodeId,
                        tableHandle, ImmutableList.of(symbol),
                        ImmutableMap.of(symbol, columnHandle),
                        BooleanLiteral.TRUE_LITERAL,
                        BooleanLiteral.TRUE_LITERAL));
        DataSource dataSource = new DataSource(null, ImmutableList.copyOf(Collections.nCopies(splitCount, split)));
View Full Code Here

                .put(D, new DualColumnHandle("d"))
                .put(E, new DualColumnHandle("e"))
                .put(F, new DualColumnHandle("f"))
                .build();

        baseTableScan = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.of(A, B, C, D, E, F),
                scanAssignments,
                BooleanLiteral.TRUE_LITERAL,
View Full Code Here

    @Test
    public void testTableScan()
            throws Exception
    {
        PlanNode node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.of(A, B, C),
                scanAssignments,
                and(greaterThan(BE, number(0)), equals(AE, DE), lessThan(DE, number(10)), lessThan(EE, number(3))),
View Full Code Here

        ImmutableList.Builder<JoinNode.EquiJoinClause> criteriaBuilder = ImmutableList.builder();
        criteriaBuilder.add(new JoinNode.EquiJoinClause(A, D));
        criteriaBuilder.add(new JoinNode.EquiJoinClause(B, E));
        List<JoinNode.EquiJoinClause> criteria = criteriaBuilder.build();

        TableScanNode leftScan = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.of(A, B, C),
                scanAssignments,
                BooleanLiteral.TRUE_LITERAL,
                BooleanLiteral.TRUE_LITERAL
        );

        TableScanNode rightScan = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.of(D, E, F),
                scanAssignments,
                BooleanLiteral.TRUE_LITERAL,
View Full Code Here

TOP

Related Classes of com.facebook.presto.sql.planner.plan.TableScanNode

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.