コード例 #1
0
        public static ImmutableArray <TableInstanceSymbol> GetDeclaredTableInstances(this BoundRelation node)
        {
            var result = new List <TableInstanceSymbol>();

            GetDeclaredTableInstances(result, node);
            return(result.ToImmutableArray());
        }
コード例 #2
0
 public BoundIntersectOrExceptRelation(bool isIntersect, BoundRelation left, BoundRelation right, IEnumerable <IComparer> comparers)
 {
     IsIntersect = isIntersect;
     Left        = left;
     Right       = right;
     Comparers   = comparers.ToImmutableArray();
 }
コード例 #3
0
ファイル: Binder.cs プロジェクト: dallmair/nquery-vnext
        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));
        }
コード例 #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));
        }
コード例 #5
0
        public BoundDerivedTableRelation Update(TableInstanceSymbol tableInstance, BoundRelation relation)
        {
            if (tableInstance == TableInstance && Relation == relation)
            {
                return(this);
            }

            return(new BoundDerivedTableRelation(tableInstance, relation));
        }
コード例 #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;
 }
コード例 #7
0
        public BoundTableSpoolPusher Update(BoundRelation input)
        {
            if (input == _input)
            {
                return(this);
            }

            return(new BoundTableSpoolPusher(input));
        }
コード例 #8
0
        public BoundExistsSubselect Update(BoundRelation relation)
        {
            if (relation == Relation)
            {
                return(this);
            }

            return(new BoundExistsSubselect(relation));
        }
コード例 #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;
 }
コード例 #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));
        }
コード例 #11
0
        public BoundSingleRowSubselect Update(ValueSlot value, BoundRelation relation)
        {
            if (value == Value && relation == Relation)
            {
                return(this);
            }

            return(new BoundSingleRowSubselect(value, relation));
        }
コード例 #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));
        }
コード例 #13
0
        public BoundFilterRelation Update(BoundRelation input, BoundExpression condition)
        {
            if (input == Input && condition == Condition)
            {
                return(this);
            }

            return(new BoundFilterRelation(input, condition));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #19
0
        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));
        }
コード例 #20
0
        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);
            }
        }
コード例 #21
0
 public BoundComputeRelation(BoundRelation input, IEnumerable <BoundComputedValue> definedValues)
 {
     Input         = input;
     DefinedValues = definedValues.ToImmutableArray();
 }
コード例 #22
0
 public BoundTableSpoolPusher(BoundRelation input)
 {
     _input = input;
 }
コード例 #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);
            }
        }
コード例 #24
0
 public BoundFilterRelation WithInput(BoundRelation input)
 {
     return(Update(input, Condition));
 }
コード例 #25
0
 public BoundSortRelation(bool isDistinct, BoundRelation input, IEnumerable <BoundComparedValue> sortedValues)
 {
     Input        = input;
     SortedValues = sortedValues.ToImmutableArray();
     IsDistinct   = isDistinct;
 }
コード例 #26
0
 public BoundDerivedTableRelation(TableInstanceSymbol tableInstance, BoundRelation relation)
 {
     TableInstance = tableInstance;
     Relation      = relation;
 }
コード例 #27
0
 public BoundJoinRelation WithRight(BoundRelation right)
 {
     return(Update(JoinType, Left, right, Condition, Probe, PassthruPredicate));
 }
コード例 #28
0
 public BoundSortRelation WithInput(BoundRelation input)
 {
     return(Update(IsDistinct, input, SortedValues));
 }
コード例 #29
0
 public BoundGroupByAndAggregationRelation(BoundRelation input, IEnumerable <BoundComparedValue> groups, IEnumerable <BoundAggregatedValue> aggregates)
 {
     Input      = input;
     Groups     = groups.ToImmutableArray();
     Aggregates = aggregates.ToImmutableArray();
 }
コード例 #30
0
 public BoundFilterRelation(BoundRelation input, BoundExpression condition)
 {
     Input     = input;
     Condition = condition;
 }