private static void VisitSubselectOnTrigger( OnTriggerDesc onTriggerDesc, ExprNodeSubselectDeclaredDotVisitor visitor) { if (onTriggerDesc is OnTriggerWindowUpdateDesc) { OnTriggerWindowUpdateDesc updates = (OnTriggerWindowUpdateDesc) onTriggerDesc; foreach (OnTriggerSetAssignment assignment in updates.Assignments) { assignment.Expression.Accept(visitor); } } else if (onTriggerDesc is OnTriggerSetDesc) { OnTriggerSetDesc sets = (OnTriggerSetDesc) onTriggerDesc; foreach (OnTriggerSetAssignment assignment in sets.Assignments) { assignment.Expression.Accept(visitor); } } else if (onTriggerDesc is OnTriggerSplitStreamDesc) { OnTriggerSplitStreamDesc splits = (OnTriggerSplitStreamDesc) onTriggerDesc; foreach (OnTriggerSplitStream split in splits.SplitStreams) { split.WhereClause?.Accept(visitor); if (split.SelectClause.SelectExprList != null) { WalkSubselectSelectClause(split.SelectClause.SelectExprList, visitor); } } } else if (onTriggerDesc is OnTriggerMergeDesc) { OnTriggerMergeDesc merge = (OnTriggerMergeDesc) onTriggerDesc; foreach (OnTriggerMergeMatched matched in merge.Items) { matched.OptionalMatchCond?.Accept(visitor); foreach (OnTriggerMergeAction action in matched.Actions) { action.OptionalWhereClause?.Accept(visitor); if (action is OnTriggerMergeActionUpdate) { OnTriggerMergeActionUpdate update = (OnTriggerMergeActionUpdate) action; foreach (OnTriggerSetAssignment assignment in update.Assignments) { assignment.Expression.Accept(visitor); } } if (action is OnTriggerMergeActionInsert) { OnTriggerMergeActionInsert insert = (OnTriggerMergeActionInsert) action; WalkSubselectSelectClause(insert.SelectClause, visitor); } } } if (merge.OptionalInsertNoMatch != null) { WalkSubselectSelectClause(merge.OptionalInsertNoMatch.SelectClause, visitor); } } }
private static void VisitSubselectOnTrigger(OnTriggerDesc onTriggerDesc, ExprNodeSubselectDeclaredDotVisitor visitor) { if (onTriggerDesc is OnTriggerWindowUpdateDesc) { OnTriggerWindowUpdateDesc updates = (OnTriggerWindowUpdateDesc)onTriggerDesc; foreach (OnTriggerSetAssignment assignment in updates.Assignments) { assignment.Expression.Accept(visitor); } } else if (onTriggerDesc is OnTriggerSetDesc) { OnTriggerSetDesc sets = (OnTriggerSetDesc)onTriggerDesc; foreach (OnTriggerSetAssignment assignment in sets.Assignments) { assignment.Expression.Accept(visitor); } } else if (onTriggerDesc is OnTriggerSplitStreamDesc) { OnTriggerSplitStreamDesc splits = (OnTriggerSplitStreamDesc)onTriggerDesc; foreach (OnTriggerSplitStream split in splits.SplitStreams) { if (split.WhereClause != null) { split.WhereClause.Accept(visitor); } if (split.SelectClause.SelectExprList != null) { foreach (SelectClauseElementRaw element in split.SelectClause.SelectExprList) { if (element is SelectClauseExprRawSpec) { SelectClauseExprRawSpec selectExpr = (SelectClauseExprRawSpec)element; selectExpr.SelectExpression.Accept(visitor); } } } } } else if (onTriggerDesc is OnTriggerMergeDesc) { OnTriggerMergeDesc merge = (OnTriggerMergeDesc)onTriggerDesc; foreach (OnTriggerMergeMatched matched in merge.Items) { if (matched.OptionalMatchCond != null) { matched.OptionalMatchCond.Accept(visitor); } foreach (OnTriggerMergeAction action in matched.Actions) { if (action.OptionalWhereClause != null) { action.OptionalWhereClause.Accept(visitor); } if (action is OnTriggerMergeActionUpdate) { OnTriggerMergeActionUpdate update = (OnTriggerMergeActionUpdate)action; foreach (OnTriggerSetAssignment assignment in update.Assignments) { assignment.Expression.Accept(visitor); } } if (action is OnTriggerMergeActionInsert) { OnTriggerMergeActionInsert insert = (OnTriggerMergeActionInsert)action; foreach (SelectClauseElementRaw element in insert.SelectClause) { if (element is SelectClauseExprRawSpec) { SelectClauseExprRawSpec selectExpr = (SelectClauseExprRawSpec)element; selectExpr.SelectExpression.Accept(visitor); } } } } } } }