public static ImmutableArray <TableInstanceSymbol> GetDeclaredTableInstances(this BoundRelation node) { var result = new List <TableInstanceSymbol>(); GetDeclaredTableInstances(result, node); return(result.ToImmutableArray()); }
public BoundIntersectOrExceptRelation(bool isIntersect, BoundRelation left, BoundRelation right, IEnumerable <IComparer> comparers) { IsIntersect = isIntersect; Left = left; Right = right; Comparers = comparers.ToImmutableArray(); }
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)); }
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)); }
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)); }
public BoundExistsSubselect Update(BoundRelation relation) { if (relation == Relation) { return(this); } return(new BoundExistsSubselect(relation)); }
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; }
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)); }
public BoundSingleRowSubselect Update(ValueSlot value, BoundRelation relation) { if (value == Value && relation == Relation) { return(this); } return(new BoundSingleRowSubselect(value, relation)); }
public BoundAssertRelation Update(BoundRelation input, BoundExpression condition, string message) { if (input == Input && condition == Condition && message == Message) { return(this); } return(new BoundAssertRelation(input, condition, message)); }
public BoundFilterRelation Update(BoundRelation input, BoundExpression condition) { if (input == Input && condition == Condition) { return(this); } return(new BoundFilterRelation(input, condition)); }
public BoundProjectRelation Update(BoundRelation input, IEnumerable <ValueSlot> outputs) { var newOutputs = outputs.ToImmutableArray(); if (input == Input && newOutputs == Outputs) { return(this); } return(new BoundProjectRelation(input, newOutputs)); }
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)); }
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)); }
public BoundComputeRelation Update(BoundRelation input, IEnumerable <BoundComputedValue> definedValues) { var newDefinedValues = definedValues.ToImmutableArray(); if (input == Input && newDefinedValues == DefinedValues) { return(this); } return(new BoundComputeRelation(input, newDefinedValues)); }
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); } }
public BoundComputeRelation(BoundRelation input, IEnumerable <BoundComputedValue> definedValues) { Input = input; DefinedValues = definedValues.ToImmutableArray(); }
public BoundTableSpoolPusher(BoundRelation input) { _input = input; }
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); } }
public BoundFilterRelation WithInput(BoundRelation input) { return(Update(input, Condition)); }
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; }
public BoundJoinRelation WithRight(BoundRelation right) { return(Update(JoinType, Left, right, Condition, Probe, PassthruPredicate)); }
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(); }
public BoundFilterRelation(BoundRelation input, BoundExpression condition) { Input = input; Condition = condition; }