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