How to extract a file having varbinary column in u-sql script using default Extractor?

418 views Asked by At

I have to Extract the varbinary column in a file. When I tried to extract it with byte[]. It show the error "Conversion Error. Column having invalid characters".

U-SQL Script:

EXTRACT Id int?,createddate DateTime?,Photo byte[] FROM @input USING Extractors.Csv(quoting: true,nullEscape:"\N");

1

There are 1 answers

9
Michael Rys On

The built-in Csv/Tsv/Text extractors assume that they operate on textual data, where the binary content is hex-encoded. This is necessary, since the binary otherwise could contain any of the delineation characters. See https://msdn.microsoft.com/en-us/library/azure/mt621366.aspx under byte[].

So if your photo is not hex-encoded, you would have to write your own custom extractor.