First published on MSDN on Jun 04, 2010
While developing some custom transforms for my talks at
the BI Conference next week
, I hit a problem where I was getting an a failed HRESULT (COM Exception) in my
() method on a call to
The error message for that exception is
The %1 is a synchronous output and the buffer type cannot be retrieved for a synchronous output.
Which really wasn’t much help in this case.
The problematic line of code was #3:
var output = ComponentMetaData.OutputCollection;
var outputColumns = output.OutputColumnCollection;
columnBufferIndex = BufferManager.FindColumnByLineageID(output.Buffer, outputColumns.LineageID);
I was looking for the LineageID of the only column my transform was adding, so (naturally) I thought that I should pass in the Buffer value for my output.
This is not the case.
Since in my case the Output was synchronous (i.e. its
was mapped to the transform’s input), you can’t access it’s Buffer output type (since it’s not outputting its own buffers – it’s reusing the one from the input).
The fix was really simple – instead of the output
, use the input buffer instead(ComponentMetadata.InputCollection.Buffer).