/// <summary> /// Translate Exists(X) into Exists(select 1 from X) /// </summary> public override Node Visit(ExistsOp op, Node n) { VisitChildren(n); // Build up a dummy project node over the input n.Child0 = BuildDummyProjectForExists(n.Child0); return n; }
/// <summary> /// Translate Exists(X) into Exists(select 1 from X) /// </summary> /// <param name="op"></param> /// <param name="n"></param> /// <returns></returns> public override Node Visit(ExistsOp op, Node n) { VisitChildren(n); // Build up a dummy project node over the input n.Child0 = BuildDummyProjectForExists(n.Child0); return(n); }
/// <summary> /// ExistsOp /// The child must be a ProjectOp - with exactly 1 var. Mark it as referenced /// </summary> /// <param name="op"> the ExistsOp </param> /// <param name="n"> the input node </param> /// <returns> </returns> public override Node Visit(ExistsOp op, Node n) { // Ensure that the child is a projectOp, and has exactly one var. Mark // that var as referenced always var projectOp = (ProjectOp)n.Child0.Op; //It is enougth to reference the first output, this usually is a simple constant AddReference(projectOp.Outputs.First); VisitChildren(n); return(n); }
public override Node Visit(ExistsOp op, Node n) { var inputVar = ((ProjectOp)n.Child0.Op).Outputs.First; VisitChildren(n); var newOutputs = ((ProjectOp)n.Child0.Op).Outputs; if (newOutputs.Count > 1) { PlanCompiler.Assert( newOutputs.IsSet(inputVar), "The constant var is not present after NestPull up over the input of ExistsOp."); newOutputs.Clear(); newOutputs.Set(inputVar); } return n; }
/// <summary> /// Mark Normalization as needed /// </summary> /// <param name="op"></param> /// <param name="n"></param> /// <returns></returns> public override Node Visit(ExistsOp op, Node n) { m_compilerState.MarkPhaseAsNeeded(PlanCompilerPhase.Normalization); return base.Visit(op, n); }
public override void Visit(ExistsOp op, Node n) { VisitScalarOpDefault(op, n); AssertRelOp(n.Child0.Op); AssertBooleanOp(op); }
public override System.Data.Entity.Core.Query.InternalTrees.Node Visit(ExistsOp op, System.Data.Entity.Core.Query.InternalTrees.Node n) { this.AddReference(((ProjectOp)n.Child0.Op).Outputs.First); this.VisitChildren(n); return(n); }
/// <summary> /// Clone an ExistsOp /// </summary> /// <param name="op">The Op to Copy</param> /// <param name="n">The Node that references the Op</param> /// <returns>A copy of the original Node that references a copy of the original Op</returns> public override Node Visit(ExistsOp op, Node n) { return(CopyDefault(m_destCmd.CreateExistsOp(), n)); }
/// <summary> /// Visitor pattern method for ExistsOp /// </summary> /// <param name="op"> The ExistsOp being visited </param> /// <param name="n"> The Node that references the Op </param> public virtual void Visit(ExistsOp op, Node n) { VisitScalarOpDefault(op, n); }
// <summary> // Clone an ExistsOp // </summary> // <param name="op"> The Op to Copy </param> // <param name="n"> The Node that references the Op </param> // <returns> A copy of the original Node that references a copy of the original Op </returns> public override Node Visit(ExistsOp op, Node n) { return CopyDefault(m_destCmd.CreateExistsOp(), n); }
public override Node Visit(ExistsOp op, Node n) { this.VisitChildren(n); n.Child0 = this.BuildDummyProjectForExists(n.Child0); return(n); }