Condividi tramite


U-SQL Built-in Outputters

Summary

U-SQL provides a built-in outputter class called Outputters that provides the following three built-in outputters to transform a rowset into a file or set of files:

  • Outputters.Text(): Provides outputting a rowset into a variety of delimited text formats.
  • Outputters.Csv(): Provides outputting a rowset into a comma-separated value (CSV) file of different encodings.
  • Outputters.Tsv(): Provides outputting a rowset into a tab-separated value (TSV) file of different encodings.

The Csv() and Tsv() outputters are special versions of the generic Text() outputter where the delimiter has been fixed to comma and tab respectively.

The built-in outputters serialize a rowset by serializing the individual data types, using a set of delimiters to identify the row and column boundaries and encode certain values according to the set parameters.

Technically speaking these are factory methods that generate an instance of the IOutputter class and they can be used in the USING clause of the OUTPUT statement. Since they create the outputter object, one does not need to call them with new.

If the OUTPUT statement specifies a file set pattern, then the outputter parameters will be applied to all the selected files equally. If different files require different parameter values, then different OUTPUT statements need to be used.

See Also