0

这是我的自定义 CDCSplitter 组件的代码

 <CustomComponent Name="CDCSplitter"
                    ComponentClassId="{874F7595-FB5F-40FF-96AF-FBFF8250E3EF}"
                    ComponentTypeName="Attunity.SqlServer.CDCSplit.CdcSplitterComponent, Attunity.SqlServer.CDCSplit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aa342389a732e31c"
                    ContactInfo="Attunity Ltd.; All Rights Reserved; http://www.attunity.com;"
                    UsesDispositions="true"
                    Version="2"
                    ValidateExternalMetadata="false">
                  <Annotations>
                    <Annotation AnnotationType="Description">Directs a stream of net change records into different outputs based on the type of the change (Insert, Delete and Update). This allows specific handling for different types of change records.</Annotation>
                  </Annotations>
                  <InputPaths>
                    <InputPath Identifier="Input" OutputPathName="CDCSource.Output">
                      <InputColumns>
                        <InputColumn SourceColumn="__$start_lsn" />
                        <InputColumn SourceColumn="__$operation" />
                        <InputColumn SourceColumn="__$update_mask" />
                         <# foreach (var column in table.Columns) { #>
                        <InputColumn SourceColumn="<#=column.Name#>" />
                       <# } #>
                      </InputColumns>
                    </InputPath>
                  </InputPaths>
                  <OutputPaths>
                    <OutputPath Name="InsertOutput">
                      <Annotations>
                        <Annotation AnnotationType="Description">Output type - Insert.</Annotation>
                      </Annotations>
                      <CustomProperties>
                        <CustomProperty Name="OutputType" DataType="Int32"
                                        TypeConverter="Attunity.SqlServer.CDCSplit.OutputType, Attunity.SqlServer.CDCSplit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aa342389a732e31c"
                                    >0</CustomProperty>
                      </CustomProperties>
                      <OutputColumns>
                        <OutputColumn Name="__$start_lsn" DataType="Binary" Length="10" />
                        <OutputColumn Name="__$operation" DataType="Int32" />
                        <OutputColumn Name="__$update_mask" DataType="Binary" Length="128" />
                        <# foreach (var column in table.Columns) { #>
                        <OutputColumn Name="<#=column.Name#>" DataType="<#=column.DataType#>" Length="<#=column.Length#>" />
                       <# } #>
                      </OutputColumns>
                      <ExternalColumns /> 
                    </OutputPath>

                    <OutputPath Name="UpdateOutput">
                      <Annotations>
                        <Annotation AnnotationType="Description">Output type - Update.</Annotation>
                      </Annotations>
                      <CustomProperties>
                        <CustomProperty Name="OutputType" DataType="Int32"
                                        TypeConverter="Attunity.SqlServer.CDCSplit.OutputType, Attunity.SqlServer.CDCSplit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aa342389a732e31c"
                                    >1</CustomProperty>
                      </CustomProperties>
                      <OutputColumns>
                        <OutputColumn Name="__$start_lsn" DataType="Binary" Length="10" />
                        <OutputColumn Name="__$operation" DataType="Int32" />
                        <OutputColumn Name="__$update_mask" DataType="Binary" Length="128" />
                         <# foreach (var column in table.Columns) { #>
                        <OutputColumn Name="<#=column.Name#>" DataType="<#=column.DataType#>" Length="<#=column.Length#>" />
                      <# } #>
                      </OutputColumns>
                    </OutputPath>

                    <OutputPath Name="DeleteOutput">
                      <Annotations>
                        <Annotation AnnotationType="Description">Output type - Delete.</Annotation>
                      </Annotations>
                      <CustomProperties>
                        <CustomProperty Name="OutputType" DataType="Int32"
                                        TypeConverter="Attunity.SqlServer.CDCSplit.OutputType, Attunity.SqlServer.CDCSplit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aa342389a732e31c"
                                    >2</CustomProperty>
                      </CustomProperties>
                      <OutputColumns>
                        <OutputColumn Name="__$start_lsn" DataType="Binary" Length="10" />
                        <OutputColumn Name="__$operation" DataType="Int32" />
                        <OutputColumn Name="__$update_mask" DataType="Binary" Length="128" />
                        <# foreach (var column in table.Columns) { #>
                        <OutputColumn Name="<#=column.Name#>" DataType="<#=column.DataType#>" Length="<#=column.Length#>"/>
                       <# } #>
                      </OutputColumns>
                    </OutputPath>

                    <OutputPath Name="ErrorOutput" IsErrorOutput="true">
                      <Annotations>
                        <Annotation AnnotationType="Description">Output type - Error.</Annotation>
                      </Annotations>
                      <CustomProperties>
                        <CustomProperty Name="OutputType" DataType="Int32"
                                        TypeConverter="Attunity.SqlServer.CDCSplit.OutputType, Attunity.SqlServer.CDCSplit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aa342389a732e31c"
                                    >3</CustomProperty>
                      </CustomProperties>
                      <OutputColumns>
                        <OutputColumn Name="__$start_lsn" DataType="Binary" Length="10" />
                        <OutputColumn Name="__$operation" DataType="Int32" />
                        <OutputColumn Name="__$update_mask" DataType="Binary" Length="128" />
                        <# foreach (var column in table.Columns) { #>
                        <OutputColumn Name="<#=column.Name#>" DataType="<#=column.DataType#>" Length="<#=column.Length#>" />
                        <# } #>
                      </OutputColumns>
                      <ExternalColumns />
                    </OutputPath>

                  </OutputPaths>


                </CustomComponent>

这个 Biml 代码编译没有错误,但是当我执行包时它抛出以下错误:

错误:DFT 增量负载_Source1 处的 0xC0047062,CDCSplitter [92]:System.ArgumentException:值不在预期范围内。在 Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSBuffer100.DirectRow(Int32 hRow, Int32 lOutputID) 在 Attunity.SqlServer.CDCSplit.CdcSplitterComponent.ProcessInput(Int32 inputId, PipelineBuffer buffer) 在 Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput (IDTSManagedComponentWrapper100 包装器,Int32 inputID,IDTSBuffer100 pDTSBuffer,IntPtr bufferWirePacket)错误:0xC0047022 在 DFT 增量 load_Source1,SSIS.Pipeline:SSIS 错误代码 DTS_E_PROCESSINPUTFAILED。在处理输入“CDCSource_Output_CDCSplitter”(94) 时,组件“CDCSplitter”(92) 上的 ProcessInput 方法失败,错误代码为 0x80070057。已识别的组件从 ProcessInput 方法返回错误。该错误是特定于组件的,但该错误是致命的,将导致数据流任务停止运行。在此之前可能会发布错误消息,其中包含有关失败的更多信息。

Biml 专家请给出处理此错误的建议

4

1 回答 1

0

找到了解决方案,如果有人遇到同样的问题,我会分享给其他人

将上述BIML代码改写为

<CustomComponent Name="CDCSplitter"
                    ComponentClassId="{874F7595-FB5F-40FF-96AF-FBFF8250E3EF}"
                    ComponentTypeName="Attunity.SqlServer.CDCSplit.CdcSplitterComponent, Attunity.SqlServer.CDCSplit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aa342389a732e31c"
                    ContactInfo="Attunity Ltd.; All Rights Reserved; http://www.attunity.com;"
                    UsesDispositions="true"
                    Version="1"
                    ValidateExternalMetadata="false">
                  <Annotations>
                    <Annotation AnnotationType="Description">Directs a stream of net change records into different outputs based on the type of the change (Insert, Delete and Update). This allows specific handling for different types of change records.</Annotation>
                  </Annotations>
                  <InputPaths>
                    <InputPath Identifier="Input" OutputPathName="CDCSource.Output" >
                      <InputColumns>
                        <InputColumn SourceColumn="__$start_lsn"  />
                        <InputColumn SourceColumn="__$operation"   />
                        <InputColumn SourceColumn="__$update_mask" />
                         <# foreach (var column in table.Columns) { #>
                        <InputColumn SourceColumn="<#=column.Name#>"  />
                       <# } #>
                      </InputColumns>
                    </InputPath>
                  </InputPaths>
                  <OutputPaths>
                    <OutputPath Name="InsertOutput" SynchronousInput="Input" ExclusionGroup="1">
                      <Annotations>
                        <Annotation AnnotationType="Description">Output type - Insert.</Annotation>
                      </Annotations>
                      <CustomProperties>
                        <CustomProperty Name="OutputType" DataType="Int32"
                                        TypeConverter="Attunity.SqlServer.CDCSplit.OutputType, Attunity.SqlServer.CDCSplit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aa342389a732e31c"
                                    >0</CustomProperty>
                      </CustomProperties>
                      <OutputColumns>
                      
                      </OutputColumns>
                      <ExternalColumns /> 
                    </OutputPath>

                    <OutputPath Name="UpdateOutput" SynchronousInput="Input" ExclusionGroup="1">
                      <Annotations>
                        <Annotation AnnotationType="Description">Output type - Update.</Annotation>
                      </Annotations>
                      <CustomProperties>
                        <CustomProperty Name="OutputType" DataType="Int32"
                                        TypeConverter="Attunity.SqlServer.CDCSplit.OutputType, Attunity.SqlServer.CDCSplit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aa342389a732e31c"
                                    >1</CustomProperty>
                      </CustomProperties>
                       <OutputColumns>
                       
                      </OutputColumns>
                    </OutputPath>

                    <OutputPath Name="DeleteOutput" SynchronousInput="Input" ExclusionGroup="1">
                      <Annotations>
                        <Annotation AnnotationType="Description">Output type - Delete.</Annotation>
                      </Annotations>
                      <CustomProperties>
                        <CustomProperty Name="OutputType" DataType="Int32"
                                        TypeConverter="Attunity.SqlServer.CDCSplit.OutputType, Attunity.SqlServer.CDCSplit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aa342389a732e31c"
                                    >2</CustomProperty>
                      </CustomProperties>
                        <OutputColumns>
                      
                      </OutputColumns>
                    </OutputPath>

                    <OutputPath Name="ErrorOutput" IsErrorOutput="true"  SynchronousInput="Input" ExclusionGroup="1">
                      <Annotations>
                        <Annotation AnnotationType="Description">Output type - Error.</Annotation>
                      </Annotations>
                      <CustomProperties>
                        <CustomProperty Name="OutputType" DataType="Int32"
                                        TypeConverter="Attunity.SqlServer.CDCSplit.OutputType, Attunity.SqlServer.CDCSplit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aa342389a732e31c"
                                    >3</CustomProperty>
                      </CustomProperties>
                       <OutputColumns>
                      
                      </OutputColumns>
                      <ExternalColumns />
                    </OutputPath>

                  </OutputPaths>


                </CustomComponent>

于 2016-07-06T23:57:40.900 回答