30 writes to Op
System.Data.Entity (30)
System\Data\Query\PlanCompiler\AggregatePushdown.cs (1)
941
candidate.Key.
Op
= m_command.CreateVarRefOp(newFunctionVar);
System\Data\Query\PlanCompiler\JoinGraph.cs (1)
1140
augmentedJoinNode.Node.
Op
= m_command.CreateInnerJoinOp();
System\Data\Query\PlanCompiler\KeyPullup.cs (1)
382
n.
Op
= m_command.CreateUnionAllOp(op.VarMap[0], op.VarMap[1], outputBranchDiscriminatorVar);
System\Data\Query\PlanCompiler\NestPullup.cs (6)
1140
projectNode.
Op
= newProjectOp;
1449
projectNode.
Op
= Command.CreateProjectOp(Command.CreateVarVec(newProjectOpOutputs));
1478
nestNode.
Op
= Command.CreateMultiStreamNestOp(nestOp.PrefixSortKeys, nestOpOutputs, newCollectionInfoList);
1564
n.Child0.
Op
= GetNestOpWithConsolidatedSortKeys(nestOp, op.Keys);
1598
nestNode.
Op
= GetNestOpWithConsolidatedSortKeys(nestOp, op.Keys);
1976
n.
Op
= Command.CreatePhysicalProjectOp(outputVars, newProjectColumnMap);
System\Data\Query\PlanCompiler\NominalTypeEliminator.cs (15)
950
n.
Op
= newOp;
1054
n.
Op
= m_command.CreateDistinctOp(newKeys);
1080
n.
Op
= m_command.CreateGroupByOp(newKeys, newOutputs);
1109
n.
Op
= m_command.CreateGroupByIntoOp(newKeys, newInputs, newOutputs);
1139
n.
Op
= m_command.CreateProjectOp(newVars);
1188
n.
Op
= m_command.CreateScanTableOp(newTable);
1298
n.
Op
= m_command.CreateSortOp(newSortKeys);
1386
n.
Op
= unnestOp;
1391
n.
Op
= m_command.CreateUnnestOp(newUnnestVar, op.Table);
1437
n.
Op
= m_command.CreateUnnestOp(newUnnestVar, newTable);
1952
n.
Op
= m_command.CreateCaseOp(newType);
2101
n.
Op
= m_command.CreateCollectOp(GetNewType(op.Type));
2245
n.
Op
= m_command.CreateConstrainedSortOp(newSortKeys, op.WithTies);
2520
n.
Op
= m_command.CreateVarRefOp(((CollectionVarInfo)varInfo).NewVar);
2525
n.
Op
= m_command.CreateVarRefOp(((PrimitiveTypeVarInfo)varInfo).NewVar);
System\Data\Query\PlanCompiler\TransformationRules.cs (3)
3221
n.
Op
= m_command.CreateVarDefOp(newVar);
3243
n.
Op
= newScanTableOp;
3312
applyNode.
Op
= context.Command.CreateOuterApplyOp();
System\Data\Query\PlanCompiler\VarRemapper.cs (3)
246
n.
Op
= m_command.CreateVarRefOp(newVar);
266
n.
Op
= m_command.CreatePhysicalProjectOp(op.Outputs, newColumnMap);
298
n.
Op
= m_command.CreateUnnestOp(newVar, op.Table);
473 references to Op
System.Data.Entity (473)
System\Data\Mapping\FunctionImportMappingComposable.cs (6)
110
PlanCompiler.Assert(rootProject.
Op
.OpType == OpType.PhysicalProject, "Expected a physical projectOp at the root of the tree - found " + rootProject.
Op
.OpType);
111
var rootProjectOp = (PhysicalProjectOp)rootProject.
Op
;
155
if (TypeSemantics.IsEnumerationType(argumentNode.
Op
.Type))
158
targetIqtCommand.CreateSoftCastOp(TypeHelpers.CreateEnumUnderlyingTypeUsage(argumentNode.
Op
.Type)),
162
Debug.Assert(TypeSemantics.IsPromotableTo(argumentNode.
Op
.Type, commandParam.ResultType), "Argument type must be promotable to parameter type.");
System\Data\Mapping\ViewGeneration\GeneratedView.cs (2)
215
PlanCompiler.Assert(itree.Root.
Op
.OpType == OpType.PhysicalProject,
216
"Expected a physical projectOp at the root of the tree - found " + itree.Root.
Op
.OpType);
System\Data\Query\InternalTrees\Command.cs (14)
1060
Debug.Assert(definingExpr.
Op
!= null);
1061
ScalarOp scalarOp = definingExpr.
Op
as ScalarOp;
1684
Debug.Assert(inputNode.
Op
.IsRelOp, "Expected a RelOp. Found " + inputNode.
Op
.OpType);
1691
Var v = this.CreateComputedVar(expr.
Op
.Type);
1717
projectVar = ((ProjectOp)projectNode.
Op
).Outputs.First;
1774
if (!Command.EqualTypes(arg0.
Op
.Type, arg1.
Op
.Type))
1776
TypeUsage commonType = TypeHelpers.GetCommonTypeUsage(arg0.
Op
.Type, arg1.
Op
.Type);
1777
Debug.Assert(commonType != null, "No common type for " + arg0.
Op
.Type + " and " + arg1.
Op
.Type);
1778
if (!EqualTypes(commonType, arg0.
Op
.Type))
1782
if (!EqualTypes(commonType, arg1.
Op
.Type))
System\Data\Query\InternalTrees\Dump.cs (1)
158
using (new AutoXml(this, n.
Op
)) {
System\Data\Query\InternalTrees\NodeInfo.cs (18)
176
m_hashValue = (m_hashValue << 4) ^ ((int)n.
Op
.OpType); // include the optype somehow
409
Debug.Assert(n.
Op
.IsScalarOp || n.
Op
.IsAncillaryOp, "not a supported optype");
431
return (definition.
Op
.OpType == OpType.Constant
432
|| definition.
Op
.OpType == OpType.InternalConstant
433
|| definition.
Op
.OpType == OpType.NullSentinel
434
|| definition.
Op
.OpType == OpType.VarRef
435
&& nonNullableInputs.IsSet(((VarRefOp)definition.
Op
).Var));
526
if (n.Child0.
Op
.OpType == OpType.VarDef && n.Child0.Child0.
Op
.OpType == OpType.Function && op.Table.Keys.Count > 0)
564
Debug.Assert(varDefListNode.
Op
.OpType == OpType.VarDefList);
569
VarRefOp varRefOp = varDefNode.Child0.
Op
as VarRefOp;
572
VarDefOp varDefOp = varDefNode.
Op
as VarDefOp;
622
VarDefOp varDefOp = chi.
Op
as VarDefOp;
705
ConstantPredicateOp predicate = n.Child1.
Op
as ConstantPredicateOp;
753
nodeInfo.NonNullableDefinitions.Set(((VarDefOp)chi.
Op
).Var);
1157
OpType.Constant == n.Child2.
Op
.OpType &&
1160
ConstantBaseOp constOp = (ConstantBaseOp)n.Child2.
Op
;
System\Data\Query\InternalTrees\Nodes.cs (4)
123
bool? opEquivalent = this.
Op
.IsEquivalent(other.
Op
);
176
if (this.
Op
.IsRelOp || this.
Op
.IsPhysicalOp)
System\Data\Query\InternalTrees\OpCopier.cs (2)
241
return n.
Op
.Accept<Node>(this, n);
1098
NestBaseOp op = n.
Op
as NestBaseOp;
System\Data\Query\InternalTrees\Rule.cs (6)
130
return node.
Op
.OpType == this.RuleOpType;
152
: base(pattern.
Op
.OpType, processDelegate)
155
Debug.Assert(pattern.
Op
!= null, "null pattern Op");
163
if (pattern.
Op
.OpType == OpType.Leaf)
165
if (pattern.
Op
.OpType != original.
Op
.OpType)
System\Data\Query\InternalTrees\RuleProcessor.cs (1)
52
foreach (Rule r in rules[(int)currentNode.
Op
.OpType])
System\Data\Query\InternalTrees\Visitors.cs (2)
56
n.
Op
.Accept(this, n);
803
return n.
Op
.Accept<TResultType>(this, n);
System\Data\Query\PlanCompiler\AggregatePushdown.cs (26)
335
if (inputNode.
Op
.OpType == OpType.SoftCast)
337
softCastOp = (SoftCastOp)inputNode.
Op
;
341
if (inputNode.
Op
.OpType == OpType.Collect)
405
if (n.Child0.
Op
.OpType != OpType.VarRef)
409
VarRefOp varRefOp = (VarRefOp)n.Child0.
Op
;
433
while (currentNode.Child0.
Op
.OpType == OpType.Project)
445
constantDefinitions.Add(((VarDefOp)definitionNode.
Op
).Var, definitionNode.Child0);
450
if (currentNode.Child0.
Op
.OpType != OpType.Unnest)
456
UnnestOp unnestOp = (UnnestOp)currentNode.Child0.
Op
;
478
PhysicalProjectOp physicalProjectOp = (PhysicalProjectOp)n.Child0.
Op
;
508
while (currentNode.
Op
.OpType == OpType.Cast)
512
return PlanCompilerUtil.IsConstantBaseOp(currentNode.
Op
.OpType);
594
return _command.CreateNode(n.
Op
, newChildren);
682
Op definingNodeOp = definingNode.
Op
;
718
Var groupAggregateVar = ((VarDefOp)child.
Op
).Var;
792
if (child.
Op
.Arity != 0)
815
if (node.
Op
.OpType != OpType.VarRef)
819
return ((VarRefOp)node.
Op
).Var == var;
902
GroupByIntoOp definingGroupOp = (GroupByIntoOp)definingGroupNode.
Op
;
905
FunctionOp functionOp = (FunctionOp)candidate.Key.
Op
;
926
GroupByIntoOp groupByOp = (GroupByIntoOp)definingGroupNode.
Op
;
933
if (groupByAncestor.
Op
.OpType == OpType.Project)
935
ProjectOp ancestorProjectOp = (ProjectOp)groupByAncestor.
Op
;
955
if (node.
Op
.OpType != OpType.Project
956
&& node.
Op
.OpType != OpType.Filter
957
&& node.
Op
.OpType != OpType.ConstrainedSort
System\Data\Query\PlanCompiler\CodeGen.cs (2)
90
PhysicalProjectOp projectOp = (PhysicalProjectOp)this.Command.Root.
Op
;
128
PhysicalProjectOp projectOp = (PhysicalProjectOp)subCommand.
Op
;
System\Data\Query\PlanCompiler\CTreeGenerator.cs (17)
405
PlanCompiler.Assert(inputNode.
Op
is RelOp, "Non-RelOp used as DbExpressionBinding Input");
527
VarDefOp defOp = childNode.
Op
as VarDefOp;
549
PlanCompiler.Assert(varDefListNode.
Op
is VarDefListOp, "EnterVarDefListScope called with non-VarDefListOp");
647
PlanCompiler.Assert(2 == n.Children.Count, string.Format(CultureInfo.InvariantCulture, "Non-Binary {0} encountered", n.
Op
.GetType().Name));
1322
PlanCompiler.Assert(n.Child0.
Op
.OpType == OpType.VarDef,
1329
DbExpression expr = input.
Op
.Accept(this, input);
1355
if (relOpNode.
Op
.OpType == OpType.Project)
1409
ProjectOp projectOp = relOpNode.
Op
as ProjectOp;
1590
bool nullSkip = (OpType.Null == n.Child1.
Op
.OpType);
1591
bool nullLimit = (OpType.Null == n.Child2.
Op
.OpType);
1737
PlanCompiler.Assert(aggRootNode.
Op
is VarDefListOp, "Invalid Aggregates VarDefListOp Node encountered in GroupByOp");
1740
VarDefOp aggVarDef = aggVarDefNode.
Op
as VarDefOp;
1748
AggregateOp funcAggOp = aggOpNode.
Op
as AggregateOp;
1836
if (joinInputNode.
Op
.OpType == OpType.Filter && joinInputNode.Child0.
Op
.OpType == OpType.ScanTable)
1838
ScanTableOp scanTableOp = (ScanTableOp)joinInputNode.Child0.
Op
;
2254
if (n.Child0.
Op
.OpType != OpType.Project)
System\Data\Query\PlanCompiler\ITreeGenerator.cs (27)
301
if (!_iqtCommand.Root.
Op
.IsRelOp)
312
if (TypeSemantics.IsCollectionType(_iqtCommand.Root.
Op
.Type))
483
if (node.
Op
.IsRelOp)
584
PlanCompiler.Assert(!node.
Op
.IsRelOp, "unexpected relOp as predicate?");
636
Op inputOp = inputNode.
Op
;
667
if (inputNode.Child0.
Op
as PhysicalProjectOp != null)
670
PlanCompiler.Assert(inputNode.Child0.Child0.
Op
.IsRelOp, "PhysicalProjectOp applied to non-RelOp input");
727
PlanCompiler.Assert(input.
Op
.IsRelOp, "unexpected non-RelOp?");
728
if (input.
Op
.OpType == OpType.Project)
751
PlanCompiler.Assert(input.
Op
.IsRelOp, "unexpected non-RelOp?");
1136
if (node.
Op
.IsRelOp)
1162
PlanCompiler.Assert(node.
Op
.IsScalarOp, "I want a scalar op");
1163
if (Command.EqualTypes(node.
Op
.Type, targetType))
1351
if (OpType.ConstrainedSort == inputNode.
Op
.OpType &&
1352
OpType.Null == inputNode.Child2.
Op
.OpType)
1367
((ConstrainedSortOp)inputNode.
Op
).WithTies = true;
1372
else if (OpType.Sort == inputNode.
Op
.OpType)
1387
_iqtCommand.CreateConstrainedSortOp(((SortOp)inputNode.
Op
).Keys, withTies),
1429
if (OpType.Project == inputNode.
Op
.OpType
1431
|| (OpType.Sort == inputNode.Child0.
Op
.OpType
1432
|| OpType.ConstrainedSort == inputNode.Child0.
Op
.OpType)))
2597
ScalarOp keyOp = keyNode.
Op
as ScalarOp;
2696
Var keyVar = ((VarDefOp)keyVarDef.
Op
).Var;
2697
Var copyOfKeyVar = ((VarDefOp)copyOfKeyVarDef.
Op
).Var;
2769
if (input.
Op
.Type.EdmType.BuiltInTypeKind == BuiltInTypeKind.RowType)
2771
IList<EdmProperty> properties = TypeHelpers.GetProperties(input.
Op
.Type);
2837
ScalarOp specOp = exprNode.
Op
as ScalarOp;
System\Data\Query\PlanCompiler\JoinGraph.cs (16)
188
ScanTableOp scanTableOp = (ScanTableOp)node.
Op
;
431
OpType joinOpType = joinNode.Node.
Op
.OpType;
644
if (joinNode.
Op
.OpType == OpType.FullOuterJoin)
687
switch (node.
Op
.OpType)
691
ScanTableOp scanTableOp = (ScanTableOp)node.
Op
;
846
OpType opType = joinNode.Node.
Op
.OpType;
889
if (joinNode.Node.
Op
.OpType == OpType.FullOuterJoin ||
933
switch (node.Node.
Op
.OpType)
1133
foreach (AugmentedJoinNode augmentedJoinNode in m_vertexes.OfType<AugmentedJoinNode>().Where(j => j.Node.
Op
.OpType == OpType.LeftOuterJoin && j.JoinEdges.Count > 0))
1185
if (parent.Node.
Op
.OpType != OpType.LeftOuterJoin || parent.Children[0] != currentNode)
1399
(disallowAnyJoin || currentParent.Node.
Op
.OpType != OpType.LeftOuterJoin || currentParent.Children[0] != currentNode)
1427
if (currentNode.Parent.Node.
Op
.OpType == OpType.LeftOuterJoin &&
2504
if (joinNode.Node.
Op
.OpType == OpType.CrossJoin)
2520
if (leftNode != null && rightNode == null && joinNode.Node.
Op
.OpType == OpType.LeftOuterJoin)
2561
Node newJoinNode = m_command.CreateNode(joinNode.Node.
Op
,
2637
switch (augmentedNode.Node.
Op
.OpType)
System\Data\Query\PlanCompiler\KeyPullup.cs (7)
88
if (chi.
Op
.IsRelOp || chi.
Op
.IsPhysicalOp)
255
if (OpType.UnionAll == branchNode.
Op
.OpType)
257
UnionAllOp branchUnionAllOp = (UnionAllOp)branchNode.
Op
;
290
if (OpType.UnionAll == branchNode.
Op
.OpType && null != ((UnionAllOp)branchNode.
Op
).BranchDiscriminator)
292
branchDiscriminatorVar = ((UnionAllOp)branchNode.
Op
).BranchDiscriminator;
System\Data\Query\PlanCompiler\NestPullup.cs (71)
103
PlanCompiler.Assert(Command.Root.
Op
.OpType == OpType.PhysicalProject, "root node is not physicalProject?");
130
PlanCompiler.Assert(n.
Op
.OpType != OpType.SingleStreamNest, "illegal singleStreamNest?");
131
return (n.
Op
.OpType == OpType.SingleStreamNest || n.
Op
.OpType == OpType.MultiStreamNest);
155
throw EntityUtil.NestingNotSupported(op, chi.
Op
);
294
if (n.Child0.
Op
.OpType == OpType.VarRef)
296
m_varRefMap.Add(op.Var, ((VarRefOp)n.Child0.
Op
).Var);
336
if (chi.
Op
.OpType == OpType.Collect)
338
throw EntityUtil.NestingNotSupported(op, chi.
Op
);
340
else if (chi.
Op
.OpType == OpType.VarRef)
342
Var refVar = ((VarRefOp)chi.
Op
).Var;
345
throw EntityUtil.NestingNotSupported(op, chi.
Op
);
363
Var inputVar = ((ProjectOp)n.Child0.
Op
).Outputs.First;
366
VarVec newOutputs = ((ProjectOp)n.Child0.
Op
).Outputs;
432
NestBaseOp nestOp = chi.
Op
as NestBaseOp;
437
if (OpType.SingleStreamNest == chi.
Op
.OpType)
463
if (op.OpType != OpType.MultiStreamNest && chi.
Op
.IsRelOp)
486
if (chi.
Op
.OpType == OpType.MultiStreamNest)
488
newCollectionInfoList.AddRange(((MultiStreamNestOp)chi.
Op
).CollectionInfo);
500
|| ((op.OpType == OpType.LeftOuterJoin || op.OpType == OpType.OuterApply) && n.Child1.
Op
.OpType == OpType.MultiStreamNest))
506
foreach (CollectionInfo collectionInfo in ((MultiStreamNestOp)chi.
Op
).CollectionInfo)
570
while (newFilterChild.
Op
.OpType == OpType.MultiStreamNest)
661
NestBaseOp nestOp = n.Child0.
Op
as NestBaseOp;
734
VarDefOp varDefOp = chi.
Op
as VarDefOp;
814
if (n.Child0.
Op
.OpType == OpType.Sort)
817
foreach (System.Data.Query.InternalTrees.SortKey key in ((SortOp)sortNode.
Op
).Keys)
856
if (newNode.
Op
.OpType == OpType.Project && IsNestOpNode(newNode.Child0))
901
NestBaseOp nestOp = (NestBaseOp)nestNode.
Op
;
903
NestBaseOp nestedNestOp = (NestBaseOp)nestedNestNode.
Op
;
982
ProjectOp op = (ProjectOp)projectNode.
Op
;
996
VarDefOp varDefOp = (VarDefOp)chi.
Op
;
999
if (OpType.Collect == definingExprNode.
Op
.OpType)
1002
PlanCompiler.Assert(OpType.PhysicalProject == definingExprNode.Child0.
Op
.OpType, "collect without physicalProject?");
1010
else if (OpType.VarRef == definingExprNode.
Op
.OpType)
1012
Var refVar = ((VarRefOp)definingExprNode.
Op
).Var;
1086
NestBaseOp nestedNestOp = (NestBaseOp)projectNode.Child0.
Op
;
1108
newNestedProjectOutputs.Set(((VarDefOp)varDefNode.
Op
).Var);
1139
projectNode.Child1 = Command.CreateNode(projectNode.Child1.
Op
, newChildren);
1187
VarDefOp varDefOp = (VarDefOp)chi.
Op
;
1205
VarDefOp varDefOp = (VarDefOp)chi.
Op
;
1241
PhysicalProjectOp physicalProjectOp = (PhysicalProjectOp)physicalProjectNode.
Op
;
1246
if (OpType.Sort == nestOpInput.
Op
.OpType)
1249
SortOp sortOp = (SortOp)nestOpInput.
Op
;
1322
ProjectOp projectOp = (ProjectOp)projectNode.
Op
;
1324
NestBaseOp nestOp = nestNode.
Op
as NestBaseOp;
1419
VarDefOp varDefOp = (VarDefOp)chi.
Op
;
1450
projectNode.Child1 = Command.CreateNode(projectNode.Child1.
Op
, newProjectOpChildren);
1481
nestNode = Command.CreateNode(nestNode.
Op
, newNestNodeChildren);
1561
NestBaseOp nestOp = n.Child0.
Op
as NestBaseOp;
1592
NestBaseOp nestOp = n.Child0.
Op
as NestBaseOp;
1745
PlanCompiler.Assert(n.Child0.
Op
.OpType == OpType.VarDef, "Unnest without VarDef input?");
1746
PlanCompiler.Assert(((VarDefOp)n.Child0.
Op
).Var == op.Var, "Unnest var not found?");
1750
if (OpType.Function == newNode.
Op
.OpType)
1757
else if (OpType.Collect == newNode.
Op
.OpType)
1764
PlanCompiler.Assert(newNode.
Op
.OpType == OpType.PhysicalProject, "collect without physicalProject?");
1769
else if (OpType.VarRef == newNode.
Op
.OpType)
1776
Var refVar = ((VarRefOp)newNode.
Op
).Var;
1783
PlanCompiler.Assert(newNode.
Op
.OpType == OpType.PhysicalProject, "driving node is not physicalProject?");
1787
throw EntityUtil.InternalError(EntityUtil.InternalErrorCode.InvalidInternalTree, 2, newNode.
Op
.OpType);
1790
IEnumerable<Var> inputVars = ((PhysicalProjectOp)newNode.
Op
).Outputs;
1796
if (newNode.
Op
.OpType == OpType.Sort)
1861
PhysicalProjectOp originalPhysicalProjectOp = (PhysicalProjectOp)keyDefiningNode.
Op
;
1964
SingleStreamNestOp ssnOp = (SingleStreamNestOp)nestNode.
Op
;
1971
SimpleCollectionColumnMap newProjectColumnMap = (SimpleCollectionColumnMap)ColumnMapTranslator.Translate(((PhysicalProjectOp)n.
Op
).ColumnMap, varRefReplacementMap);
2122
MultiStreamNestOp nestOp = (MultiStreamNestOp)nestNode.
Op
;
2130
if (chi.
Op
.OpType == OpType.MultiStreamNest)
2146
VarVec childKeys = Command.CreateVarVec(((SingleStreamNestOp)nestNode.Children[i].
Op
).Keys);
2370
SingleStreamNestOp ssnOp = inputNode.
Op
as SingleStreamNestOp;
2389
SortOp sortOp = inputNode.
Op
as SortOp;
2709
MultiStreamNestOp newOp = (MultiStreamNestOp)result.
Op
;
2754
if (command.Root.Child0 != null && command.Root.Child0.
Op
.OpType == OpType.Sort)
System\Data\Query\PlanCompiler\NominalTypeEliminator.cs (37)
202
PlanCompiler.Assert(rootNode.
Op
.OpType == OpType.PhysicalProject, "root node is not PhysicalProjectOp?");
204
rootNode.
Op
.Accept(this, rootNode);
291
Op inputOp = input.
Op
;
369
PlanCompiler.Assert(node.
Op
.IsScalarOp, "Attempting SoftCast around non-ScalarOp?");
370
if (Command.EqualTypes(node.
Op
.Type, targetType))
375
while (node.
Op
.OpType == OpType.SoftCast)
780
PlanCompiler.Assert(chi.
Op
is VarDefOp, "VarDefOp expected");
782
VarDefOp varDefOp = (VarDefOp)chi.
Op
;
805
Node newVarDefListNode = m_command.CreateNode(n.
Op
, newChildren);
825
PlanCompiler.Assert(definingExprNode.
Op
.OpType != OpType.Function, "Flattening of TVF output is not allowed.");
1200
switch (n.
Op
.OpType)
1204
ProjectOp projectOp = (ProjectOp)n.
Op
;
1209
ScanTableOp tableOp = (ScanTableOp)n.
Op
;
1223
SetOp setOp = (SetOp)n.
Op
;
1229
UnnestOp unnestOp = (UnnestOp)n.
Op
;
1235
DistinctOp distinctOp = (DistinctOp)n.
Op
;
1325
VarDefOp varDefOp = chi.
Op
as VarDefOp;
1333
if (chi.HasChild0 && chi.Child0.
Op
.OpType == OpType.Function)
1340
processingTVF = ((FunctionOp)chi.Child0.
Op
).Function;
1723
md.TypeUsage inputTypeUsage = n.Child0.
Op
.Type;
1733
PlanCompiler.Assert(n.Child0.
Op
.OpType == OpType.NewRecord, "Expected a record constructor here. Found " + n.Child0.
Op
.OpType + " instead");
1813
PlanCompiler.Assert(Command.EqualTypes(newType, n.Child0.
Op
.Type),
1836
PlanCompiler.Assert(md.TypeSemantics.IsPrimitiveType(n.Child0.
Op
.Type), "Primitive type expected.");
1844
PlanCompiler.Assert(md.TypeSemantics.IsPrimitiveType(n.Child0.
Op
.Type, md.PrimitiveTypeKind.Geography) || md.TypeSemantics.IsPrimitiveType(n.Child0.
Op
.Type, md.PrimitiveTypeKind.Geometry), "Union spatial type expected.");
1856
if (underlyingType.PrimitiveTypeKind == ((md.PrimitiveType)n.Child0.
Op
.Type.EdmType).PrimitiveTypeKind)
1991
if (!m_typeInfo.GetTypeInfo(n.
Op
.Type).HasNullSentinelProperty)
1997
if (resultNode.
Op
.OpType != OpType.NewRecord)
2005
PlanCompiler.Assert(currentNullSentinel.
Op
.Type.EdmEquals(integerType), "Column that is expected to be a null sentinel is not of Integer type.");
2117
md.TypeUsage child0Type = ((ScalarOp)n.Child0.
Op
).Type;
2118
md.TypeUsage child1Type = ((ScalarOp)n.Child1.
Op
).Type;
2197
md.TypeUsage childOpType = ((ScalarOp)n.Child0.
Op
).Type;
2285
TypeInfo inputTypeInfo = m_typeInfo.GetTypeInfo(((ScalarOp)n.Child0.
Op
).Type);
2336
md.TypeUsage inputType = n.Child0.
Op
.Type;
2436
TypeInfo inputTypeInfo = m_typeInfo.GetTypeInfo(((ScalarOp)n.Child0.
Op
).Type);
2943
ScalarOp arg = (ScalarOp)n.Child0.
Op
;
System\Data\Query\PlanCompiler\Normalizer.cs (8)
116
PlanCompiler.Assert(collectionNode.
Op
.IsScalarOp, "non-scalar usage of Unnest?");
117
PlanCompiler.Assert(TypeSemantics.IsCollectionType(collectionNode.
Op
.Type), "non-collection usage for Unnest?");
138
UnnestOp unnestOp = unnestNode.
Op
as UnnestOp;
141
CollectOp collectOp = m_command.CreateCollectOp(n.
Op
.Type);
171
if (OpType.SoftCast == argNode.
Op
.OpType)
173
softCastType = TypeHelpers.GetEdmType<CollectionType>(argNode.
Op
.Type).TypeUsage;
176
while (OpType.SoftCast == argNode.
Op
.OpType)
183
UnnestOp unnestOp = unnestNode.
Op
as UnnestOp;
System\Data\Query\PlanCompiler\PlanCompilerUtil.cs (6)
50
if (!n.Child1.
Op
.Type.EdmEquals(op.Type) || !n.Child2.
Op
.Type.EdmEquals(op.Type))
56
if (n.Child1.
Op
.OpType == OpType.Null)
61
if (n.Child2.
Op
.OpType == OpType.Null)
82
TypeSemantics.IsCollectionType(n.Child0.
Op
.Type) &&
152
node => (node.
Op
.OpType != OpType.And),
System\Data\Query\PlanCompiler\Predicate.cs (14)
218
if (part.
Op
.OpType != OpType.EQ)
276
if (andTree.
Op
.OpType == OpType.And)
344
if (simplePredicateNode.
Op
.OpType != OpType.EQ)
349
VarRefOp leftVarOp = simplePredicateNode.Child0.
Op
as VarRefOp;
354
VarRefOp rightVarOp = simplePredicateNode.Child1.
Op
as VarRefOp;
425
switch (simplePredNode.
Op
.OpType)
433
varRefOp = simplePredNode.Child0.
Op
as VarRefOp;
438
varRefOp = simplePredNode.Child1.
Op
as VarRefOp;
446
if (simplePredNode.Child0.
Op
.OpType != OpType.IsNull)
450
varRefOp = simplePredNode.Child0.Child0.
Op
as VarRefOp;
456
ConstantBaseOp constantOp = simplePredNode.Child1.
Op
as ConstantBaseOp;
461
varRefOp = simplePredNode.Child0.
Op
as VarRefOp;
480
if (left.
Op
.OpType != OpType.VarRef)
484
VarRefOp varRefOp = (VarRefOp)left.
Op
;
System\Data\Query\PlanCompiler\PreProcessor.cs (26)
199
PhysicalProjectOp ppOp = (PhysicalProjectOp)m_command.Root.
Op
; // this better be the case or we have other problems.
407
if (viewNode.
Op
.OpType == OpType.Project)
409
DiscriminatedNewEntityOp discriminatedNewEntityOp = viewNode.Child1.Child0.Child0.
Op
as DiscriminatedNewEntityOp;
480
if (navigateOpNode.Child0.
Op
.OpType == OpType.GetEntityRef &&
652
m_command.CreateGetEntityRefOp(derefOpNode.Child0.
Op
.Type),
1092
ProjectOp projectOp = (ProjectOp)subQueryRelOp.
Op
;
1228
if (op.OpType == OpType.IsNull && TypeSemantics.IsRowType(n.Child0.
Op
.Type) || TypeSemantics.IsComplexType(n.Child0.
Op
.Type))
1230
StructuredTypeNullabilityAnalyzer.MarkAsNeedingNullSentinel(m_typesNeedingNullSentinel, n.Child0.
Op
.Type);
1308
if (n.
Op
.OpType != OpType.Property || (!Helper.IsNavigationProperty(((PropertyOp)n.
Op
).PropertyInfo)))
1314
if (currentNode.
Op
.OpType == OpType.SoftCast)
1318
return currentNode.
Op
.OpType == OpType.VarRef;
1375
if (CanRewriteTypeTest(op.Type.EdmType, n.Child0.
Op
.Type.EdmType))
1400
if (CanRewriteTypeTest(op.IsOfType.EdmType, n.Child0.
Op
.Type.EdmType))
1673
m_command.CreateNode(m_command.CreateGetRefKeyOp(keyExpr.
Op
.Type), sourceEndNode));
2044
if (node.
Op
.OpType != OpType.Constant && node.
Op
.OpType != OpType.Null)
2225
if (ancestor.
Op
.OpType == OpType.PhysicalProject)
2270
IsOfOp isOfOp = n.Child1.
Op
as IsOfOp;
2278
ScanTableOp scanTableOp = n.Child0.
Op
as ScanTableOp;
2286
VarRefOp varRefOp = n.Child1.Child0.
Op
as VarRefOp;
2314
Node ret = ProcessScanTable(n.Child0, (ScanTableOp)n.Child0.
Op
, ref typeFilter);
2342
if (OpType.Sort == n.Child0.
Op
.OpType || OpType.ConstrainedSort == n.Child0.
Op
.OpType)
2344
SortBaseOp sort = (SortBaseOp)n.Child0.
Op
;
System\Data\Query\PlanCompiler\ProjectionPruner.cs (12)
301
VarDefOp varDefOp = chi.
Op
as VarDefOp;
420
if (op.Keys.Count > 1 && n.Child0.
Op
.OpType == OpType.Project)
422
RemoveRedundantConstantKeys(op.Keys, ((ProjectOp)n.Child0.
Op
).Outputs, n.Child0.Child1);
532
List<Node> constantKeys = varDefListNode.Children.Where(d => d.
Op
.OpType == OpType.VarDef
533
&& PlanCompilerUtil.IsConstantBaseOp(d.Child0.
Op
.OpType)).ToList();
535
VarVec constantKeyVars = this.m_command.CreateVarVec(constantKeys.Select(d => ((VarDefOp)d.
Op
).Var));
544
varDefListNode.Children.RemoveAll(c => constantKeys.Contains(c) && constantKeyVars.IsSet(((VarDefOp)c.
Op
).Var));
550
Var keyVar = ((VarDefOp)keyNode.
Op
).Var;
569
if (result.
Op
.OpType == OpType.GroupByInto && n.Child3.Children.Count == 0)
571
GroupByIntoOp newOp = (GroupByIntoOp)result.
Op
;
595
if (n.
Op
.OpType == OpType.CrossJoin)
781
ProjectOp projectOp = (ProjectOp)n.Child0.
Op
;
System\Data\Query\PlanCompiler\PropertyPushdownHelper.cs (5)
114
rootNode.
Op
.Accept(this, rootNode);
253
ScalarOp chiOp = chi.
Op
as ScalarOp;
350
md.TypeUsage childOpType = (n.Child0.
Op
as ScalarOp).Type;
393
ScalarOp childOp = n.Child0.
Op
as ScalarOp;
662
if (n.
Op
.OpType == OpType.CrossJoin)
System\Data\Query\PlanCompiler\ProviderCommandInfoUtils.cs (1)
57
PhysicalProjectOp projectOp = node.
Op
as PhysicalProjectOp;
System\Data\Query\PlanCompiler\SubqueryTrackingVisitor.cs (10)
98
if (n.
Op
.IsRelOp)
102
else if (n.
Op
.IsPhysicalOp)
207
n.
Op
.OpType == OpType.Project || n.
Op
.OpType == OpType.Filter ||
208
n.
Op
.OpType == OpType.GroupBy || n.
Op
.OpType == OpType.GroupByInto,
209
"VisitRelOpDefault: Unexpected op?" + n.
Op
.OpType);
240
PlanCompiler.Assert(n.
Op
.OpType == OpType.InnerJoin ||
241
n.
Op
.OpType == OpType.LeftOuterJoin ||
242
n.
Op
.OpType == OpType.FullOuterJoin, "unexpected op?");
System\Data\Query\PlanCompiler\TransformationRules.cs (125)
89
PlanCompiler.Assert(node.
Op
.IsScalarOp, "Expected a scalarOp: Found " + Dump.AutoString.ToString(node.
Op
.OpType));
92
if (node.
Op
.OpType == OpType.VarRef)
94
VarRefOp varRefOp = node.
Op
as VarRefOp;
126
if (node.
Op
.OpType == OpType.VarRef)
128
VarRefOp op = node.
Op
as VarRefOp;
200
if (this.m_relOpAncestors.Any(a => IsOpNotSafeForNullSentinelValueChange(a.
Op
.OpType)))
208
a.
Op
.OpType == OpType.CrossApply ||
209
a.
Op
.OpType == OpType.OuterApply);
244
if (IsOpNotSafeForNullSentinelValueChange(n.
Op
.OpType))
291
VarDefListOp varDefListOp = (VarDefListOp)varDefListNode.
Op
;
296
VarDefOp varDefOp = (VarDefOp)chi.
Op
;
347
Node thenNode = this.Command.CreateNode(this.Command.CreateNullOp(elseNode.
Op
.Type));
348
Node caseNode = this.Command.CreateNode(this.Command.CreateCaseOp(elseNode.
Op
.Type), whenNode, thenNode, elseNode);
450
if (subTree.
Op
.IsRelOp)
479
if (subtree.
Op
.IsRelOp)
549
if (!node.
Op
.IsScalarOp)
559
if (varRefMap != null && node.
Op
.OpType == OpType.VarRef)
561
VarRefOp varRefOp = (VarRefOp)node.
Op
;
841
CaseOp caseOp = (CaseOp)caseOpNode.
Op
;
930
if (OpType.SoftCast == caseOpNode.Children[i].
Op
.OpType)
945
if (OpType.SoftCast == caseOpNode.Children[i + 1].
Op
.OpType)
951
if (caseOpNode.Children[i].
Op
.OpType != OpType.ConstantPredicate)
963
ConstantPredicateOp constPred = (ConstantPredicateOp)caseOpNode.Children[i].
Op
;
1039
if (elseChild.
Op
.OpType != OpType.Case)
1076
PlanCompiler.Assert(node.
Op
.OpType == OpType.EQ || node.
Op
.OpType == OpType.NE, "unexpected comparison op type?");
1078
bool? comparisonStatus = node.Child0.
Op
.IsEquivalent(node.Child1.
Op
);
1084
bool result = (node.
Op
.OpType == OpType.EQ) ? (bool)comparisonStatus : !((bool)comparisonStatus);
1132
InternalConstantOp patternOp = (InternalConstantOp)n.Child1.
Op
;
1133
InternalConstantOp strOp = (InternalConstantOp)n.Child0.
Op
;
1195
ConstantPredicateOp pred = (ConstantPredicateOp)constantPredicateNode.
Op
;
1197
switch (node.
Op
.OpType)
1210
PlanCompiler.Assert(false, "Unexpected OpType - " + node.
Op
.OpType);
1298
newNode = context.Command.CreateNode(context.Command.CreateNullOp(castNullOp.
Op
.Type));
1325
Var v = ((VarRefOp)isNullNode.Child0.
Op
).Var;
1466
if (predicateNode.
Op
.OpType == OpType.ConstantPredicate)
1500
Node newProjectNode = trc.Command.CreateNode(projectNode.
Op
, newFilterNode, projectNode.Child1);
1565
SetOp setOp = (SetOp)setOpNode.
Op
;
1590
if (branchId == 0 && filterNode.
Op
.OpType != OpType.Except)
1606
Node newSetOpNode = trc.Command.CreateNode(setOpNode.
Op
, newSetOpChildren);
1661
Node newDistinctNode = context.Command.CreateNode(distinctNode.
Op
, pushdownFilterNode);
1704
GroupByOp groupByOp = (GroupByOp)groupByNode.
Op
;
1743
Node newGroupByNode = trc.Command.CreateNode(groupByNode.
Op
, subFilterNode, groupByNode.Child1, groupByNode.Child2);
1807
Op joinOp = joinNode.
Op
;
1840
if (leftInputNode.
Op
.OpType != OpType.ScanTable)
1847
if ((rightInputNode.
Op
.OpType != OpType.ScanTable) &&
1960
Op applyOp = applyNode.
Op
;
2003
ConstantPredicateOp predOp = (ConstantPredicateOp)n.Child1.
Op
;
2021
if (n.Child0.
Op
.OpType == OpType.SingleRowTable ||
2022
(n.Child0.
Op
.OpType == OpType.Project &&
2023
n.Child0.Child0.
Op
.OpType == OpType.SingleRowTable))
2113
ProjectOp projectOp = (ProjectOp)projectNode.
Op
;
2116
ProjectOp subProjectOp = (ProjectOp)subProjectNode.
Op
;
2152
VarDefOp varDefOp = (VarDefOp)chi.
Op
;
2223
ProjectOp projectOp = (ProjectOp)n.
Op
;
2243
if (definingExprNode.
Op
.OpType == OpType.VarRef)
2245
VarRefOp varRefOp = (VarRefOp)definingExprNode.
Op
;
2270
VarDefOp varDefOp = (VarDefOp)varDefNode.
Op
;
2271
VarRefOp varRefOp = varDefNode.Child0.
Op
as VarRefOp;
2329
ProjectOp projectOp = (ProjectOp)n.
Op
;
2332
if (varDefListNode.Children.Where(c => c.Child0.
Op
.OpType == OpType.NullSentinel).Count() == 0)
2348
if (!canChangeNullSentinelValue || !TransformationRulesContext.TryGetInt32Var(n.Child1.Children.Where(child => child.Child0.
Op
.OpType == OpType.Constant || child.Child0.
Op
.OpType == OpType.InternalConstant).Select(child => ((VarDefOp)(child.
Op
)).Var), out inputSentinel))
2350
inputSentinel = n.Child1.Children.Where(child => child.Child0.
Op
.OpType == OpType.NullSentinel).Select(child => ((VarDefOp)(child.
Op
)).Var).FirstOrDefault();
2364
if (definingExprNode.
Op
.OpType == OpType.NullSentinel)
2373
else if (!inputSentinel.Equals(((VarDefOp)varDefNode.
Op
).Var))
2375
projectOp.Outputs.Clear(((VarDefOp)varDefNode.
Op
).Var);
2377
trc.AddVarMapping(((VarDefOp)varDefNode.
Op
).Var, inputSentinel);
2459
if (applyNode.
Op
.OpType == OpType.CrossApply)
2515
ProjectOp projectOp = (ProjectOp)projectNode.
Op
;
2568
if (varDefNode.Child0.
Op
.OpType == OpType.NullSentinel && sentinelIsInt32 && trc.CanChangeNullSentinelValue)
2642
ProjectOp projectOp = (ProjectOp)projectNode.
Op
as ProjectOp;
2720
(varDefListNode.Child0.Child0.
Op
.OpType == OpType.InternalConstant || varDefListNode.Child0.Child0.
Op
.OpType == OpType.NullSentinel))
2743
PlanCompiler.Assert(varDefNode.
Op
.OpType == OpType.VarDef, "Expected VarDefOp. Found " + varDefNode.
Op
.OpType + " instead");
2744
VarRefOp varRefOp = varDefNode.Child0.
Op
as VarRefOp;
2763
if (nullSentinelDefinitionOp != null && ((true == nullSentinelDefinitionOp.IsEquivalent(varDefNode.Child0.
Op
)) ||
2765
varDefNode.Child0.
Op
.OpType == OpType.NullSentinel))
2797
ProjectOp projectOp = (ProjectOp)projectNode.
Op
;
2831
ApplyBaseOp applyOp = (ApplyBaseOp)applyNode.
Op
;
2920
OpType applyKind = applyNode.
Op
.OpType;
3220
Var newVar = m_command.CreateComputedVar(n.Child0.
Op
.Type);
3306
ConstantPredicateOp joinPredicate = (ConstantPredicateOp)joinNode.Child2.
Op
;
3415
if ((joinNode.
Op
.OpType != OpType.LeftOuterJoin) &&
3416
(joinNode.Child0.
Op
.OpType == OpType.Project) &&
3417
(joinNode.Child1.
Op
.OpType == OpType.Project))
3419
ProjectOp projectOp1 = (ProjectOp)joinNode.Child0.
Op
;
3420
ProjectOp projectOp2 = (ProjectOp)joinNode.Child1.
Op
;
3433
newJoinNode = context.Command.CreateNode(joinNode.
Op
, joinNode.Child0.Child0, joinNode.Child1.Child0, joinConditionNode);
3437
newJoinNode = context.Command.CreateNode(joinNode.
Op
, joinNode.Child0.Child0, joinNode.Child1.Child0);
3459
if (joinNode.Child0.
Op
.OpType == OpType.Project)
3466
PlanCompiler.Assert(joinNode.
Op
.OpType != OpType.LeftOuterJoin, "unexpected non-LeftOuterJoin");
3472
ProjectOp projectOp = projectNode.
Op
as ProjectOp;
3560
if (joinNode.Child0.
Op
.OpType == OpType.Filter)
3568
if (joinNode.Child1.
Op
.OpType == OpType.Filter && joinNode.
Op
.OpType != OpType.LeftOuterJoin)
3593
if (joinNode.
Op
.OpType == OpType.CrossJoin)
3595
newJoinNode = command.CreateNode(joinNode.
Op
, newLeftInput, newRightInput);
3599
newJoinNode = command.CreateNode(joinNode.
Op
, newLeftInput, newRightInput, joinNode.Child2);
3647
if (joinNode.Child0.
Op
.OpType == OpType.SingleRowTable)
3722
if (singleRowNode.Child0.
Op
.OpType == OpType.Filter)
3824
SetOp setOp = (SetOp)setOpNode.
Op
;
3881
GroupByOp groupByOp = (GroupByOp)n.
Op
;
3902
if (definingExprNode.
Op
.OpType == OpType.VarRef)
3904
VarRefOp varRefOp = (VarRefOp)definingExprNode.
Op
;
3928
VarDefOp varDefOp = (VarDefOp)varDefNode.
Op
;
3929
VarRefOp varRefOp = varDefNode.Child0.
Op
as VarRefOp;
3976
GroupByOp op = (GroupByOp)n.
Op
;
4006
if (varDefNode.Child0.
Op
.OpType == OpType.Constant || varDefNode.Child0.
Op
.OpType == OpType.InternalConstant || varDefNode.Child0.
Op
.OpType == OpType.NullSentinel)
4015
projectDefinitions.Clear(((VarDefOp)varDefNode.
Op
).Var);
4030
Var var = ((VarDefOp)varDefNode.
Op
).Var;
4178
GroupByOp op = (GroupByOp)n.
Op
;
4231
var rootOp = context.Command.Root.
Op
as PhysicalProjectOp;
4238
if (n.Child0.
Op
.OpType != OpType.ScanTable)
4246
|| n.Child2.Child0.Child0.
Op
.OpType != OpType.Aggregate)
4251
var groupByOp = (GroupByOp)n.
Op
;
4253
var sourceTable = ((ScanTableOp)n.Child0.
Op
).Table;
4432
DistinctOp op = (DistinctOp)n.
Op
;
System\Data\Query\PlanCompiler\VarRefManager.cs (7)
119
switch (node.
Op
.OpType)
124
return HasVarReferences(((SortBaseOp)node.
Op
).Keys, vars);
128
return HasVarReferences(((DistinctOp)node.
Op
).Keys, vars);
134
return HasVarReferences((SetOp)node.
Op
, vars, childIndex);
138
return HasVarReferences(((GroupByOp)node.
Op
).Keys, vars);
142
return HasVarReferences(((PhysicalProjectOp)node.
Op
).Outputs, vars);
146
return HasVarReferences(((ProjectOp)node.
Op
).Outputs, vars);