本文整理汇总了C#中System.Data.Query.InternalTrees.Node.GetExtendedNodeInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Node.GetExtendedNodeInfo方法的具体用法?C# Node.GetExtendedNodeInfo怎么用?C# Node.GetExtendedNodeInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.Query.InternalTrees.Node
的用法示例。
在下文中一共展示了Node.GetExtendedNodeInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetKeys
/// <summary>
/// Pull up keys (if possible) for the given node
/// </summary>
/// <param name="node">node to pull up keys for</param>
/// <returns>Keys for the node</returns>
internal KeyVec GetKeys(Node node)
{
ExtendedNodeInfo nodeInfo = node.GetExtendedNodeInfo(m_command);
if (nodeInfo.Keys.NoKeys)
{
VisitNode(node);
}
return nodeInfo.Keys;
}
示例2: ProjectOpCase1
//.........这里部分代码省略.........
&& referencedVars.Count == 0)
{
// We'll just pick the NestNode; we expect MergeNestedNestOps to merge
// it into what we're about to generate later.
projectNode = projectNode.Child0;
EnsureReferencedVarsAreRemoved(referencedVars, outputVars);
}
else
{
var nestedNestOp = (NestBaseOp)projectNode.Child0.Op;
// Build the new ProjectOp to be used as input to the new nestedNestOp;
// it's input is the input to the current nestedNestOp and a new
// VarDefList with only the vars that were defined on the top level
// ProjectOp.
var newNestedProjectNodeInputs = new List<Node>();
newNestedProjectNodeInputs.Add(projectNode.Child0.Child0);
referencedVars.AddRange(definedVars);
newNestedProjectNodeInputs.Add(Command.CreateNode(Command.CreateVarDefListOp(), referencedVars));
var newNestedProjectOutputs = Command.CreateVarVec(nestedNestOp.Outputs);
// SQLBUDT #508722: We need to remove the collection vars,
// these are not produced by the project
foreach (var ci in nestedNestOp.CollectionInfo)
{
newNestedProjectOutputs.Clear(ci.CollectionVar);
}
foreach (var varDefNode in referencedVars)
{
newNestedProjectOutputs.Set(((VarDefOp)varDefNode.Op).Var);
}
var newNestedProjectNode = Command.CreateNode(
Command.CreateProjectOp(newNestedProjectOutputs), newNestedProjectNodeInputs);
// Now build the new nestedNestedNestOp, with the new nestedProjectOp
// as it's input; we have to update the outputs of the NestOp to include
// the vars we pushed down.
var newNestedNestOutputs = Command.CreateVarVec(newNestedProjectOutputs);
newNestedNestOutputs.Or(nestedNestOp.Outputs);
var newNestedNestOp = Command.CreateMultiStreamNestOp(
nestedNestOp.PrefixSortKeys,
newNestedNestOutputs,
nestedNestOp.CollectionInfo);
var newNestedNestNodeInputs = new List<Node>();
newNestedNestNodeInputs.Add(newNestedProjectNode);
for (var j = 1; j < projectNode.Child0.Children.Count; j++)
{
newNestedNestNodeInputs.Add(projectNode.Child0.Children[j]);
}
projectNode = Command.CreateNode(newNestedNestOp, newNestedNestNodeInputs);
// We don't need to remove or remap referenced vars here because
// we're including them on the node we create; they won't become
// invalid.
}
}
else
{
var newProjectOp = Command.CreateProjectOp(newProjectVars);
projectNode.Child1 = Command.CreateNode(projectNode.Child1.Op, newChildren);
projectNode.Op = newProjectOp;
EnsureReferencedVarsAreRemapped(referencedVars);
}
}
else
{
projectNode = projectNode.Child0;
EnsureReferencedVarsAreRemoved(referencedVars, outputVars);
}
// We need to make sure that we project out any external references to the driving
// node that the nested collections have, or we're going to end up with unresolvable
// vars when we pull them up over the current driving node. Of course, we only
// want the references that are actually ON the driving node.
externalReferences.And(projectNode.GetExtendedNodeInfo(Command).Definitions);
outputVars.Or(externalReferences);
// There are currently no prefix sortkeys. The processing for a SortOp may later
// introduce some prefix sortkeys, but there aren't any now.
var nestOp = Command.CreateMultiStreamNestOp(new List<SortKey>(), outputVars, collectionInfoList);
// Insert the current node at the head of the the list of collections
collectionNodes.Insert(0, projectNode);
var nestNode = Command.CreateNode(nestOp, collectionNodes);
// Finally, recompute node info
Command.RecomputeNodeInfo(projectNode);
Command.RecomputeNodeInfo(nestNode);
#if DEBUG
var size = input.Length; // GC.KeepAlive makes FxCop Grumpy.
var output = Dump.ToXml(nestNode);
#endif
//DEBUG
return nestNode;
}
示例3: GetExtendedNodeInfo
/// <summary>
/// Get extended node information for a RelOpNode
/// </summary>
/// <param name="n">the node</param>
/// <returns>extended node info for this node</returns>
internal ExtendedNodeInfo GetExtendedNodeInfo(Node n)
{
return n.GetExtendedNodeInfo(this);
}