Exemple #1
0
        public static void CreateAndRegister(AstNode astNode, LoweringContext context)
        {
            var astQuerySourceNode = astNode as AstQuerySourceNode;
            if (astQuerySourceNode != null)
            {
                var oleDBSource = new OleDBSource(context, astNode) { _oleDBConnection = new OleDBConnection(astQuerySourceNode.Connection) };

                // Note: vsabella: workaround for different behavior regarding expressions for OLEDB sources 
                // versus how it works in Lookups.
                if (astQuerySourceNode.Query.QueryType == QueryType.Expression)
                {
                    // Variable name has to be only alphanumeric, more restrictive than astQuerySource Name
                    string varName = "__" + System.Guid.NewGuid().ToString("N");
                    var variable = new Variable(varName);
                    oleDBSource.SqlCommandVarName = "User::" + varName;

                    variable.TypeCode = System.TypeCode.String;
                    variable.EvaluateAsExpression = true;
                    variable.ValueString = astQuerySourceNode.Query.Body;
                    context.ParentObject.Children.Add(variable);
                }
                else
                {
                    foreach (AstVariableParameterMappingNode paramNode in astQuerySourceNode.Query.Parameters)
                    {
                        var variable = new Variable(paramNode.Variable);
                        oleDBSource._paramDictionary[paramNode.Name] = variable;
                        context.ParentObject.Children.Add(variable);
                    }
                }

                context.ParentObject.Children.Add(oleDBSource._oleDBConnection);
                context.ParentObject.Children.Add(oleDBSource);
            }
        }
        public static void LowerPackage(AstNode astNode, LoweringContext context)
        {
            var astPackage = astNode as AstTask.AstPackageNode;

            if (astPackage != null)
            {
                if (astPackage.Emit)
                {
                    var p = new Package(astPackage);
                    context.ParentObject.Children.Add(p);
                    context = new TaskLoweringContext(p);
                    LowerConnection(astPackage.LogConnection, context);
                    LowerChildren(astPackage, context);
                    LowerEventHandlers(astPackage, p, context);
                }
                else
                {
                    MessageEngine.Trace(
                        astPackage,
                        Severity.Debug,
                        "D_S008",
                        "Skipped Lowering of Package {0} because Emit was {1}",
                        astPackage.Name,
                        astPackage.Emit);
                }
            }
        }
Exemple #3
0
 protected Transformation(LoweringContext context, AstTransformationNode astTransformationNode)
     : base(astTransformationNode.Name)
 {
     var dflc = context as DataflowLoweringContext;
     Dataflow = dflc.Dataflow;
     ValidateExternalMetadata = astTransformationNode.ValidateExternalMetadata;
     BindingList = new Collection<Binding>();
     _astTransformationNode = astTransformationNode;
 }
Exemple #4
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     var astOleDBCommandNode = astNode as AstOleDBCommandNode;
     if (astOleDBCommandNode != null)
     {
         var oleDBCommand = new OleDBCommand(context, astNode) { _oleDBConnection = new OleDBConnection(astOleDBCommandNode.Connection) };
         context.ParentObject.Children.Add(oleDBCommand._oleDBConnection);
         context.ParentObject.Children.Add(oleDBCommand);
     }
 }
Exemple #5
0
 public static void LowerExecutePackage(AstNode astNode, LoweringContext context)
 {
     var astTask = astNode as AstExecutePackageTaskNode;
     if (astTask != null)
     {
         var ep = new ExecutePackageTask(astTask);
         context.ParentObject.Children.Add(ep);
         ContainerLoweringEngine.LowerEventHandlers(astTask, ep, context);
     }
 }
Exemple #6
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     var astDestination = astNode as AstDestinationNode;
     if (astDestination != null)
     {
         var oleDBDestination = new OleDBDestination(context, astNode) { _oleDBConnection = new OleDBConnection(astDestination.Table.Connection) };
         context.ParentObject.Children.Add(oleDBDestination._oleDBConnection);
         context.ParentObject.Children.Add(oleDBDestination);
     }
 }
Exemple #7
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     var astTermLookupNode = astNode as AstTermLookupNode;
     if (astTermLookupNode != null)
     {
         var termLookup = new TermLookup(context, astNode) { _oleDBConnection = new OleDBConnection(astTermLookupNode.Connection) };
         context.ParentObject.Children.Add(termLookup._oleDBConnection);
         context.ParentObject.Children.Add(termLookup);
     }
 }
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     var astSlowlyChangingDimensionNode = astNode as AstSlowlyChangingDimensionNode;
     if (astSlowlyChangingDimensionNode != null)
     {
         var slowlyChangingDimension = new SlowlyChangingDimension(context, astNode) { _oleDBConnection = new OleDBConnection(astSlowlyChangingDimensionNode.Connection) };
         context.ParentObject.Children.Add(slowlyChangingDimension._oleDBConnection);
         context.ParentObject.Children.Add(slowlyChangingDimension);
     }
 }
Exemple #9
0
 public static void LowerSqlTask(AstNode astNode, LoweringContext context)
 {
     var astTask  = astNode as AstExecuteSqlTaskNode;
     if (astTask != null)
     {
         var s = new SqlTask(astTask);
         ContainerLoweringEngine.LowerConnection(astTask.Connection, context);
         context.ParentObject.Children.Add(s);
         ContainerLoweringEngine.LowerEventHandlers(astTask, s, context);
     }
 }
 public static void Lower(AstNode node, LoweringContext context)
 {
     Type nodeType = node.GetType();
     if (LoweringDictionary.ContainsKey(nodeType))
     {
         foreach (AstLoweringHandler handler in LoweringDictionary[nodeType])
         {
             handler(node, context);
         }
     }
 }
Exemple #11
0
        public static void Lower(AstNode node, LoweringContext context)
        {
            Type nodeType = node.GetType();

            if (LoweringDictionary.ContainsKey(nodeType))
            {
                foreach (AstLoweringHandler handler in LoweringDictionary[nodeType])
                {
                    handler(node, context);
                }
            }
        }
Exemple #12
0
        public static void LowerDataflow(AstNode astNode, LoweringContext context)
        {
            var astDataflow = astNode as AstEtlRootNode;
            if (astDataflow != null)
            {
                var dft = new DataflowTask(astDataflow);
                context.ParentObject.Children.Add(dft);

                var dflc = new DataflowLoweringContext(dft);
                LowerTransformations(astDataflow, dflc);
                ContainerLoweringEngine.LowerEventHandlers(astDataflow, dft, context);
            }
        }
Exemple #13
0
        public Union(LoweringContext context, AstNode astNode)
            : base(context, astNode as AstTransformationNode)
        {
            _astUnionAllNode = astNode as AstUnionAllNode;

            if (_astUnionAllNode != null)
            {
                int i = 0;
                foreach (AstDataflowMappedInputPathNode ip in _astUnionAllNode.InputPaths)
                {
                    BindingList.Add(new MappedBinding(_astUnionAllNode.Name, ip.OutputPath.Transformation.Name, ip.OutputPath.SsisName, i, ip.Mappings));
                    i++;
                }
            }
        }
        public static void LowerContainer(AstNode astNode, LoweringContext context)
        {
            var astContainer = astNode as AstTask.AstContainerTaskNode;

            if (astContainer != null)
            {
                var seq = new PhysicalTask.Sequence(astContainer);
                context.ParentObject.Children.Add(seq);
                LowerConnection(astContainer.LogConnection, context);

                context = new TaskLoweringContext(seq);
                LowerChildren(astContainer, context);
                LowerEventHandlers(astContainer, seq, context);
            }
        }
        public static void LowerForLoop(AstNode astNode, LoweringContext context)
        {
            var astContainer = astNode as AstTask.AstForLoopContainerTaskNode;

            if (astContainer != null)
            {
                var forLoop = new PhysicalTask.ForLoop(astContainer);
                context.ParentObject.Children.Add(forLoop);
                LowerConnection(astContainer.LogConnection, context);

                context = new TaskLoweringContext(forLoop);
                LowerChildren(astContainer, context);
                LowerEventHandlers(astContainer, forLoop, context);
            }
        }
Exemple #16
0
 public DerivedColumns(LoweringContext context, AstNode astNode)
     : base(context, astNode as AstTransformationNode)
 {
     _astDerivedColumnListNode = astNode as AstDerivedColumnListNode;
     RegisterInputBinding(_astDerivedColumnListNode);
 }
Exemple #17
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     context.ParentObject.Children.Add((new DerivedColumns(context, astNode)));
 }
 protected SingleOutTransformation(LoweringContext context, AstTransformationNode astTransformationNode) : base(context, astTransformationNode)
 {
 }
Exemple #19
0
 public ConditionalSplit(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _astConditionalSplitNode = astNode as AstConditionalSplitNode;
     RegisterInputBinding(_astConditionalSplitNode);
 }
Exemple #20
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     context.ParentObject.Children.Add((new ConditionalSplit(context, astNode)));
 }
Exemple #21
0
 public static void LowerOleDBSource(AstNode astNode, LoweringContext context)
 {
     OleDBSource.CreateAndRegister(astNode, context);
 }
Exemple #22
0
 public static void LowerSort(AstNode astNode, LoweringContext context)
 {
     Sort.CreateAndRegister(astNode, context);
 }
Exemple #23
0
 public TermLookup(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _astTermLookupNode = astNode as AstTermLookupNode;
     RegisterInputBinding(_astTermLookupNode);
 }
Exemple #24
0
 public static void LowerRowCount(AstNode astNode, LoweringContext context)
 {
     RowCount.CreateAndRegister(astNode, context);
 }
Exemple #25
0
 public RowCount(LoweringContext context, AstNode astNode)
     : base(context, astNode as AstTransformationNode)
 {
     _astRowCountNode = astNode as AstRowCountNode;
     RegisterInputBinding(_astRowCountNode);
 }
Exemple #26
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     context.ParentObject.Children.Add(new Union(context, astNode));
 }
Exemple #27
0
 public OleDBSource(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _paramDictionary = new Dictionary<string, Variable>();
     _astQuerySourceNode = astNode as AstQuerySourceNode;
 }
Exemple #28
0
 public static void LowerDestination(AstNode astNode, LoweringContext context)
 {
     OleDBDestination.CreateAndRegister(astNode, context);
 }
Exemple #29
0
 public static void LowerOleDBCommand(AstNode astNode, LoweringContext context)
 {
     OleDBCommand.CreateAndRegister(astNode, context);
 }
 public SlowlyChangingDimension(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _astSlowlyChangingDimensionNode = astNode as AstSlowlyChangingDimensionNode;
     RegisterInputBinding(_astSlowlyChangingDimensionNode);
 }
Exemple #31
0
 public OleDBDestination(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _astDestination = astNode as AstDestinationNode;
     RegisterInputBinding(_astDestination);
 }