private static void ProcessSuccessor(AstEtlFragmentReferenceNode fragmentReference, AstEtlFragmentNode clonedFragment, GraphNode<AstTransformationNode> etlSinkNode, AstSingleInTransformationNode successor) { if (successor.InputPath == null) { successor.InputPath = new AstDataflowMappedInputPathNode(successor); successor.InputPath.OutputPath = etlSinkNode.Item.PreferredOutputPath; } // TODO: ////successor.InputPath.OutputPath = etlSinkNode.Item.OutputPath; foreach (var outputMapping in fragmentReference.Outputs) { var currentMapping = new AstDataflowColumnMappingNode(successor.InputPath) { SourceName = outputMapping.SourcePathColumnName, TargetName = outputMapping.DestinationPathColumnName }; successor.InputPath.Mappings.Add(currentMapping); } foreach (var inputMapping in fragmentReference.Inputs) { var currentMapping = new AstDataflowColumnMappingNode(successor.InputPath) { SourceName = inputMapping.DestinationPathColumnName, TargetName = inputMapping.SourcePathColumnName }; successor.InputPath.Mappings.Add(currentMapping); } foreach (var ignore in clonedFragment.Ignores) { var currentMapping = new AstDataflowColumnMappingNode(successor.InputPath) { SourceName = ignore.PathColumnName }; successor.InputPath.Mappings.Add(currentMapping); } }
public static void ValidateEtlFragmentReference(AstEtlFragmentReferenceNode fragmentReference) { if (fragmentReference.Inputs.Count != fragmentReference.EtlFragment.Inputs.Count) { MessageEngine.Trace(fragmentReference, Severity.Error, "V0124", "The fragment reference input mapping count does not match the exposed input count of the fragment."); } if (fragmentReference.Outputs.Count != fragmentReference.EtlFragment.Outputs.Count) { MessageEngine.Trace(fragmentReference, Severity.Error, "V0125", "The fragment reference output mapping count does not match the exposed output count of the fragment."); } foreach (var input in fragmentReference.Inputs) { if (!fragmentReference.EtlFragment.Inputs.Any(decl => decl.PathColumnName.Equals(input.DestinationPathColumnName))) { MessageEngine.Trace(fragmentReference, Severity.Error, "V0126", "The fragment reference input column mapping with source {0} did not match the exposed input columns in the fragment.", input.SourcePathColumnName); } } foreach (var output in fragmentReference.Outputs) { if (!fragmentReference.EtlFragment.Outputs.Any(decl => decl.PathColumnName.Equals(output.SourcePathColumnName))) { MessageEngine.Trace(fragmentReference, Severity.Error, "V0127", "A fragment reference output column mapping with destination {0} did not match the exposed output columns in the fragment.", output.DestinationPathColumnName); } } }