public static ImmutableArray <TableInstanceSymbol> GetDeclaredTableInstances(this BoundRelation node)
        {
            var result = new List <TableInstanceSymbol>();

            GetDeclaredTableInstances(result, node);
            return(result.ToImmutableArray());
        }
Exemplo n.º 2
0
 public BoundIntersectOrExceptRelation(bool isIntersect, BoundRelation left, BoundRelation right, IEnumerable <IComparer> comparers)
 {
     IsIntersect = isIntersect;
     Left        = left;
     Right       = right;
     Comparers   = comparers.ToImmutableArray();
 }
Exemplo n.º 3
0
        private Binder CreateJoinConditionBinder(BoundRelation left, BoundRelation right)
        {
            var leftTables  = left.GetDeclaredTableInstances();
            var rightTables = right.GetDeclaredTableInstances();
            var tables      = leftTables.Concat(rightTables);

            return(new JoinConditionBinder(_sharedBinderState, this, tables));
        }
Exemplo n.º 4
0
        public BoundJoinRelation Update(BoundJoinType joinType, BoundRelation left, BoundRelation right, BoundExpression condition, ValueSlot probe, BoundExpression passthruPredicate)
        {
            if (joinType == JoinType && left == Left && right == Right && condition == Condition && probe == Probe && passthruPredicate == PassthruPredicate)
            {
                return(this);
            }

            return(new BoundJoinRelation(joinType, left, right, condition, probe, passthruPredicate));
        }
        public BoundDerivedTableRelation Update(TableInstanceSymbol tableInstance, BoundRelation relation)
        {
            if (tableInstance == TableInstance && Relation == relation)
            {
                return(this);
            }

            return(new BoundDerivedTableRelation(tableInstance, relation));
        }
Exemplo n.º 6
0
 public BoundJoinRelation(BoundJoinType joinType, BoundRelation left, BoundRelation right, BoundExpression condition, ValueSlot probe, BoundExpression passthruPredicate)
 {
     Left              = left;
     Right             = right;
     JoinType          = joinType;
     Condition         = condition;
     Probe             = probe;
     PassthruPredicate = passthruPredicate;
 }
        public BoundTableSpoolPusher Update(BoundRelation input)
        {
            if (input == _input)
            {
                return(this);
            }

            return(new BoundTableSpoolPusher(input));
        }
Exemplo n.º 8
0
        public BoundExistsSubselect Update(BoundRelation relation)
        {
            if (relation == Relation)
            {
                return(this);
            }

            return(new BoundExistsSubselect(relation));
        }
Exemplo n.º 9
0
 public BoundHashMatchRelation(BoundHashMatchOperator logicalOperator, BoundRelation build, BoundRelation probe, ValueSlot buildKey, ValueSlot probeKey, BoundExpression remainder)
 {
     LogicalOperator = logicalOperator;
     Build           = build;
     Probe           = probe;
     BuildKey        = buildKey;
     ProbeKey        = probeKey;
     Remainder       = remainder;
 }
Exemplo n.º 10
0
        public BoundHashMatchRelation Update(BoundHashMatchOperator logicalOperator, BoundRelation build, BoundRelation probe, ValueSlot buildKey, ValueSlot probeKey, BoundExpression remainder)
        {
            if (logicalOperator == LogicalOperator && build == Build && probe == Probe && buildKey == BuildKey && probeKey == ProbeKey && remainder == Remainder)
            {
                return(this);
            }

            return(new BoundHashMatchRelation(logicalOperator, build, probe, buildKey, probeKey, remainder));
        }
Exemplo n.º 11
0
        public BoundSingleRowSubselect Update(ValueSlot value, BoundRelation relation)
        {
            if (value == Value && relation == Relation)
            {
                return(this);
            }

            return(new BoundSingleRowSubselect(value, relation));
        }
Exemplo n.º 12
0
        public BoundAssertRelation Update(BoundRelation input, BoundExpression condition, string message)
        {
            if (input == Input && condition == Condition && message == Message)
            {
                return(this);
            }

            return(new BoundAssertRelation(input, condition, message));
        }
Exemplo n.º 13
0
        public BoundFilterRelation Update(BoundRelation input, BoundExpression condition)
        {
            if (input == Input && condition == Condition)
            {
                return(this);
            }

            return(new BoundFilterRelation(input, condition));
        }
Exemplo n.º 14
0
        public BoundProjectRelation Update(BoundRelation input, IEnumerable <ValueSlot> outputs)
        {
            var newOutputs = outputs.ToImmutableArray();

            if (input == Input && newOutputs == Outputs)
            {
                return(this);
            }

            return(new BoundProjectRelation(input, newOutputs));
        }
Exemplo n.º 15
0
        public BoundTopRelation Update(BoundRelation input, int limit, IEnumerable <BoundComparedValue> tieEntries)
        {
            var newTieEntries = tieEntries.ToImmutableArray();

            if (input == Input && limit == Limit && newTieEntries == TieEntries)
            {
                return(this);
            }

            return(new BoundTopRelation(input, limit, newTieEntries));
        }
Exemplo n.º 16
0
        public BoundSortRelation Update(bool isDistinct, BoundRelation input, IEnumerable <BoundComparedValue> sortedValues)
        {
            var newSortedValues = sortedValues.ToImmutableArray();

            if (isDistinct == IsDistinct && input == Input && newSortedValues == SortedValues)
            {
                return(this);
            }

            return(new BoundSortRelation(isDistinct, input, newSortedValues));
        }
Exemplo n.º 17
0
        public BoundComputeRelation Update(BoundRelation input, IEnumerable <BoundComputedValue> definedValues)
        {
            var newDefinedValues = definedValues.ToImmutableArray();

            if (input == Input && newDefinedValues == DefinedValues)
            {
                return(this);
            }

            return(new BoundComputeRelation(input, newDefinedValues));
        }
Exemplo n.º 18
0
        public BoundIntersectOrExceptRelation Update(bool isIntersect, BoundRelation left, BoundRelation right, IEnumerable <IComparer> comparers)
        {
            var newComparers = comparers.ToImmutableArray();

            if (isIntersect == IsIntersect && left == Left && right == Right && newComparers == Comparers)
            {
                return(this);
            }

            return(new BoundIntersectOrExceptRelation(isIntersect, left, right, newComparers));
        }
        public BoundGroupByAndAggregationRelation Update(BoundRelation input, IEnumerable <BoundComparedValue> groups, IEnumerable <BoundAggregatedValue> aggregates)
        {
            var newGroups     = groups.ToImmutableArray();
            var newAggregates = aggregates.ToImmutableArray();

            if (input == Input && newGroups == Groups && newAggregates == Aggregates)
            {
                return(this);
            }

            return(new BoundGroupByAndAggregationRelation(input, newGroups, newAggregates));
        }
        public virtual void VisitRelation(BoundRelation node)
        {
            switch (node.Kind)
            {
            case BoundNodeKind.TableRelation:
                VisitTableRelation((BoundTableRelation)node);
                break;

            case BoundNodeKind.DerivedTableRelation:
                VisitDerivedTableRelation((BoundDerivedTableRelation)node);
                break;

            case BoundNodeKind.JoinRelation:
                VisitJoinRelation((BoundJoinRelation)node);
                break;

            case BoundNodeKind.HashMatchRelation:
                VisitHashMatchRelation((BoundHashMatchRelation)node);
                break;

            case BoundNodeKind.ComputeRelation:
                VisitComputeRelation((BoundComputeRelation)node);
                break;

            case BoundNodeKind.FilterRelation:
                VisitFilterRelation((BoundFilterRelation)node);
                break;

            case BoundNodeKind.GroupByAndAggregationRelation:
                VisitGroupByAndAggregationRelation((BoundGroupByAndAggregationRelation)node);
                break;

            case BoundNodeKind.StreamAggregatesRelation:
                VisitStreamAggregatesRelation((BoundStreamAggregatesRelation)node);
                break;

            case BoundNodeKind.ConstantRelation:
                VisitConstantRelation((BoundConstantRelation)node);
                break;

            case BoundNodeKind.UnionRelation:
                VisitUnionRelation((BoundUnionRelation)node);
                break;

            case BoundNodeKind.ConcatenationRelation:
                VisitConcatenationRelation((BoundConcatenationRelation)node);
                break;

            case BoundNodeKind.IntersectOrExceptRelation:
                VisitIntersectOrExceptRelation((BoundIntersectOrExceptRelation)node);
                break;

            case BoundNodeKind.ProjectRelation:
                VisitProjectRelation((BoundProjectRelation)node);
                break;

            case BoundNodeKind.SortRelation:
                VisitSortRelation((BoundSortRelation)node);
                break;

            case BoundNodeKind.TopRelation:
                VisitTopRelation((BoundTopRelation)node);
                break;

            case BoundNodeKind.AssertRelation:
                VisitAssertRelation((BoundAssertRelation)node);
                break;

            case BoundNodeKind.TableSpoolPusher:
                VisitTableSpoolPusher((BoundTableSpoolPusher)node);
                break;

            case BoundNodeKind.TableSpoolPopper:
                VisitTableSpoolPopper((BoundTableSpoolPopper)node);
                break;

            default:
                throw ExceptionBuilder.UnexpectedValue(node.Kind);
            }
        }
Exemplo n.º 21
0
 public BoundComputeRelation(BoundRelation input, IEnumerable <BoundComputedValue> definedValues)
 {
     Input         = input;
     DefinedValues = definedValues.ToImmutableArray();
 }
Exemplo n.º 22
0
 public BoundTableSpoolPusher(BoundRelation input)
 {
     _input = input;
 }
Exemplo n.º 23
0
        public virtual BoundRelation RewriteRelation(BoundRelation node)
        {
            switch (node.Kind)
            {
            case BoundNodeKind.TableRelation:
                return(RewriteTableRelation((BoundTableRelation)node));

            case BoundNodeKind.DerivedTableRelation:
                return(RewriteDerivedTableRelation((BoundDerivedTableRelation)node));

            case BoundNodeKind.JoinRelation:
                return(RewriteJoinRelation((BoundJoinRelation)node));

            case BoundNodeKind.HashMatchRelation:
                return(RewriteHashMatchRelation((BoundHashMatchRelation)node));

            case BoundNodeKind.ComputeRelation:
                return(RewriteComputeRelation((BoundComputeRelation)node));

            case BoundNodeKind.FilterRelation:
                return(RewriteFilterRelation((BoundFilterRelation)node));

            case BoundNodeKind.GroupByAndAggregationRelation:
                return(RewriteGroupByAndAggregationRelation((BoundGroupByAndAggregationRelation)node));

            case BoundNodeKind.StreamAggregatesRelation:
                return(RewriteStreamAggregatesRelation((BoundStreamAggregatesRelation)node));

            case BoundNodeKind.ConstantRelation:
                return(RewriteConstantRelation((BoundConstantRelation)node));

            case BoundNodeKind.UnionRelation:
                return(RewriteUnionRelation((BoundUnionRelation)node));

            case BoundNodeKind.ConcatenationRelation:
                return(RewriteConcatenationRelation((BoundConcatenationRelation)node));

            case BoundNodeKind.IntersectOrExceptRelation:
                return(RewriteIntersectOrExceptRelation((BoundIntersectOrExceptRelation)node));

            case BoundNodeKind.ProjectRelation:
                return(RewriteProjectRelation((BoundProjectRelation)node));

            case BoundNodeKind.SortRelation:
                return(RewriteSortRelation((BoundSortRelation)node));

            case BoundNodeKind.TopRelation:
                return(RewriteTopRelation((BoundTopRelation)node));

            case BoundNodeKind.AssertRelation:
                return(RewriteAssertRelation((BoundAssertRelation)node));

            case BoundNodeKind.TableSpoolPusher:
                return(RewriteTableSpoolPusher((BoundTableSpoolPusher)node));

            case BoundNodeKind.TableSpoolPopper:
                return(RewriteTableSpoolPopper((BoundTableSpoolPopper)node));

            default:
                throw ExceptionBuilder.UnexpectedValue(node.Kind);
            }
        }
Exemplo n.º 24
0
 public BoundFilterRelation WithInput(BoundRelation input)
 {
     return(Update(input, Condition));
 }
Exemplo n.º 25
0
 public BoundSortRelation(bool isDistinct, BoundRelation input, IEnumerable <BoundComparedValue> sortedValues)
 {
     Input        = input;
     SortedValues = sortedValues.ToImmutableArray();
     IsDistinct   = isDistinct;
 }
 public BoundDerivedTableRelation(TableInstanceSymbol tableInstance, BoundRelation relation)
 {
     TableInstance = tableInstance;
     Relation      = relation;
 }
Exemplo n.º 27
0
 public BoundJoinRelation WithRight(BoundRelation right)
 {
     return(Update(JoinType, Left, right, Condition, Probe, PassthruPredicate));
 }
Exemplo n.º 28
0
 public BoundSortRelation WithInput(BoundRelation input)
 {
     return(Update(IsDistinct, input, SortedValues));
 }
 public BoundGroupByAndAggregationRelation(BoundRelation input, IEnumerable <BoundComparedValue> groups, IEnumerable <BoundAggregatedValue> aggregates)
 {
     Input      = input;
     Groups     = groups.ToImmutableArray();
     Aggregates = aggregates.ToImmutableArray();
 }
Exemplo n.º 30
0
 public BoundFilterRelation(BoundRelation input, BoundExpression condition)
 {
     Input     = input;
     Condition = condition;
 }