Examples of GeneratedPartitions


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

            // Construct the post scan predicate. Add the unevaluated TupleDomain back first since those are generally cheaper to evaluate than anything we can't extract
            Expression postScanPredicate = combineConjuncts(unevaluatedDomainPredicate, extractionRemainingExpression);

            // Do some early partition pruning
            partitions = ImmutableList.copyOf(filter(partitions, not(shouldPrunePartition(postScanPredicate, node.getAssignments()))));
            GeneratedPartitions generatedPartitions = new GeneratedPartitions(tupleDomain, partitions);

            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();
View Full Code Here

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

            // Construct the post scan predicate. Add the unevaluated TupleDomain back first since those are generally cheaper to evaluate than anything we can't extract
            Expression postScanPredicate = combineConjuncts(unevaluatedDomainPredicate, extractionRemainingExpression);

            // Do some early partition pruning
            partitions = ImmutableList.copyOf(filter(partitions, not(shouldPrunePartition(postScanPredicate, node.getAssignments()))));
            GeneratedPartitions generatedPartitions = new GeneratedPartitions(tupleDomain, partitions);

            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();
View Full Code Here

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

            // Construct the post scan predicate. Add the unevaluated TupleDomain back first since those are generally cheaper to evaluate than anything we can't extract
            Expression postScanPredicate = combineConjuncts(unevaluatedDomainPredicate, extractionRemainingExpression);

            // Do some early partition pruning
            partitions = ImmutableList.copyOf(filter(partitions, not(shouldPrunePartition(postScanPredicate, node.getAssignments()))));
            GeneratedPartitions generatedPartitions = new GeneratedPartitions(tupleDomain, partitions);

            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();
View Full Code Here

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

            // Construct the post scan predicate. Add the unevaluated TupleDomain back first since those are generally cheaper to evaluate than anything we can't extract
            Expression postScanPredicate = combineConjuncts(unevaluatedDomainPredicate, extractionRemainingExpression);

            // Do some early partition pruning
            partitions = ImmutableList.copyOf(filter(partitions, not(shouldPrunePartition(postScanPredicate, node.getAssignments()))));
            GeneratedPartitions generatedPartitions = new GeneratedPartitions(tupleDomain, partitions);

            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();
View Full Code Here

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

            // Construct the post scan predicate. Add the unevaluated TupleDomain back first since those are generally cheaper to evaluate than anything we can't extract
            Expression postScanPredicate = combineConjuncts(unevaluatedDomainPredicate, extractionRemainingExpression);

            // Do some early partition pruning
            partitions = ImmutableList.copyOf(filter(partitions, not(shouldPrunePartition(postScanPredicate, node.getAssignments()))));
            GeneratedPartitions generatedPartitions = new GeneratedPartitions(tupleDomain, partitions);

            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();
View Full Code Here

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

                newId(),
                DUAL_TABLE_HANDLE,
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(scanAssignments.get(A), Domain.singleValue(1L))),
                        ImmutableList.<Partition>of())));
        effectivePredicate = EffectivePredicateExtractor.extract(node, TYPES);
        Assert.assertEquals(effectivePredicate, BooleanLiteral.FALSE_LITERAL);

        // tupleDomainInput with non-descriptive partitions
        node = new TableScanNode(
                newId(),
                DUAL_TABLE_HANDLE,
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(scanAssignments.get(A), Domain.singleValue(1L))),
                        ImmutableList.of(new Partition("test", new TestingPartition())))));
        effectivePredicate = EffectivePredicateExtractor.extract(node, TYPES);
        Assert.assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(number(1L), AE)));

        // tupleDomainInput with descriptive partitions
        node = new TableScanNode(
                newId(),
                DUAL_TABLE_HANDLE,
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(scanAssignments.get(A), Domain.singleValue(1L))),
                        ImmutableList.<Partition>of(tupleDomainPartition("test",
                                TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
                                        scanAssignments.get(A), Domain.singleValue(1L),
                                        scanAssignments.get(B), Domain.singleValue(2L))))))));
        effectivePredicate = EffectivePredicateExtractor.extract(node, TYPES);
        Assert.assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(number(2L), BE), equals(number(1L), AE)));

        // generic tupleDomainInput with no matching partitions
        node = new TableScanNode(
                newId(),
                DUAL_TABLE_HANDLE,
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.<ColumnHandle>all(),
                        ImmutableList.<Partition>of())));
        effectivePredicate = EffectivePredicateExtractor.extract(node, TYPES);
        Assert.assertEquals(effectivePredicate, BooleanLiteral.FALSE_LITERAL);

        // generic tupleDomainInput with non-descriptive partitions
        node = new TableScanNode(
                newId(),
                DUAL_TABLE_HANDLE,
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.<ColumnHandle>all(),
                        ImmutableList.of(new Partition("test", new TestingPartition())))));
        effectivePredicate = EffectivePredicateExtractor.extract(node, TYPES);
        Assert.assertEquals(effectivePredicate, BooleanLiteral.TRUE_LITERAL);

        // generic tupleDomainInput with descriptive partitions
        node = new TableScanNode(
                newId(),
                DUAL_TABLE_HANDLE,
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.<ColumnHandle>all(),
                        ImmutableList.of(tupleDomainPartition("test",
                                TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
                                        scanAssignments.get(A), Domain.singleValue(1L),
                                        scanAssignments.get(B), Domain.singleValue(2L))))))));
        effectivePredicate = EffectivePredicateExtractor.extract(node, TYPES);
        Assert.assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(number(2L), BE), equals(number(1L), AE)));

        // Make sure only output symbols are produced
        node = new TableScanNode(
                newId(),
                DUAL_TABLE_HANDLE,
                ImmutableList.of(A),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
                                scanAssignments.get(A), Domain.singleValue(1L),
                                scanAssignments.get(D), Domain.singleValue(3L))),
                        ImmutableList.of(tupleDomainPartition("test",
                                TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
View Full Code Here

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

            // Construct the post scan predicate. Add the unevaluated TupleDomain back first since those are generally cheaper to evaluate than anything we can't extract
            Expression postScanPredicate = combineConjuncts(unevaluatedDomainPredicate, extractionRemainingExpression);

            // Do some early partition pruning
            partitions = ImmutableList.copyOf(filter(partitions, not(shouldPrunePartition(postScanPredicate, node.getAssignments()))));
            GeneratedPartitions generatedPartitions = new GeneratedPartitions(tupleDomain, partitions);

            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();
View Full Code Here

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

            // Construct the post scan predicate. Add the unevaluated TupleDomain back first since those are generally cheaper to evaluate than anything we can't extract
            Expression postScanPredicate = combineConjuncts(unevaluatedDomainPredicate, extractionRemainingExpression);

            // Do some early partition pruning
            partitions = ImmutableList.copyOf(filter(partitions, not(shouldPrunePartition(postScanPredicate, node.getAssignments()))));
            GeneratedPartitions generatedPartitions = new GeneratedPartitions(tupleDomain, partitions);

            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();
View Full Code Here

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

                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(scanAssignments.get(A), Domain.singleValue(1L))),
                        ImmutableList.<Partition>of())));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(effectivePredicate, BooleanLiteral.FALSE_LITERAL);

        // tupleDomainInput with non-descriptive partitions
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(scanAssignments.get(A), Domain.singleValue(1L))),
                        ImmutableList.<Partition>of(new DualPartition()))));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(number(1L), AE)));

        // tupleDomainInput with descriptive partitions
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(scanAssignments.get(A), Domain.singleValue(1L))),
                        ImmutableList.<Partition>of(tupleDomainPartition(TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
                                scanAssignments.get(A), Domain.singleValue(1L),
                                scanAssignments.get(B), Domain.singleValue(2L))))))));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(number(2L), BE), equals(number(1L), AE)));

        // generic tupleDomainInput with no matching partitions
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.all(),
                        ImmutableList.<Partition>of())));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(effectivePredicate, BooleanLiteral.FALSE_LITERAL);

        // generic tupleDomainInput with non-descriptive partitions
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.all(),
                        ImmutableList.<Partition>of(new DualPartition()))));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(effectivePredicate, BooleanLiteral.TRUE_LITERAL);

        // generic tupleDomainInput with descriptive partitions
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.all(),
                        ImmutableList.<Partition>of(tupleDomainPartition(TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
                                scanAssignments.get(A), Domain.singleValue(1L),
                                scanAssignments.get(B), Domain.singleValue(2L))))))));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(number(2L), BE), equals(number(1L), AE)));

        // Make sure only output symbols are produced
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.of(A),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
                                scanAssignments.get(A), Domain.singleValue(1L),
                                scanAssignments.get(D), Domain.singleValue(3L))),
                        ImmutableList.<Partition>of(tupleDomainPartition(TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
                                scanAssignments.get(A), Domain.singleValue(1L),
View Full Code Here

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

                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(scanAssignments.get(A), Domain.singleValue(1L))),
                        ImmutableList.<Partition>of())));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(effectivePredicate, BooleanLiteral.FALSE_LITERAL);

        // tupleDomainInput with non-descriptive partitions
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(scanAssignments.get(A), Domain.singleValue(1L))),
                        ImmutableList.<Partition>of(new DualPartition()))));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(number(1L), AE)));

        // tupleDomainInput with descriptive partitions
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(scanAssignments.get(A), Domain.singleValue(1L))),
                        ImmutableList.<Partition>of(tupleDomainPartition(TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
                                scanAssignments.get(A), Domain.singleValue(1L),
                                scanAssignments.get(B), Domain.singleValue(2L))))))));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(number(2L), BE), equals(number(1L), AE)));

        // generic tupleDomainInput with no matching partitions
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.all(),
                        ImmutableList.<Partition>of())));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(effectivePredicate, BooleanLiteral.FALSE_LITERAL);

        // generic tupleDomainInput with non-descriptive partitions
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.all(),
                        ImmutableList.<Partition>of(new DualPartition()))));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(effectivePredicate, BooleanLiteral.TRUE_LITERAL);

        // generic tupleDomainInput with descriptive partitions
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.copyOf(assignments.keySet()),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.all(),
                        ImmutableList.<Partition>of(tupleDomainPartition(TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
                                scanAssignments.get(A), Domain.singleValue(1L),
                                scanAssignments.get(B), Domain.singleValue(2L))))))));
        effectivePredicate = EffectivePredicateExtractor.extract(node);
        Assert.assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(number(2L), BE), equals(number(1L), AE)));

        // Make sure only output symbols are produced
        node = new TableScanNode(
                newId(),
                new DualTableHandle("default"),
                ImmutableList.of(A),
                assignments,
                null,
                Optional.<GeneratedPartitions>of(new GeneratedPartitions(
                        TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
                                scanAssignments.get(A), Domain.singleValue(1L),
                                scanAssignments.get(D), Domain.singleValue(3L))),
                        ImmutableList.<Partition>of(tupleDomainPartition(TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(
                                scanAssignments.get(A), Domain.singleValue(1L),
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.