Skip to content

Instantly share code, notes, and snippets.

@rjdudley
Created September 25, 2018 03:27
Show Gist options
  • Save rjdudley/2b96f8a532fc4a9504d9f8ea02b27ef7 to your computer and use it in GitHub Desktop.
Save rjdudley/2b96f8a532fc4a9504d9f8ea02b27ef7 to your computer and use it in GitHub Desktop.
Boilerplate U-SQL User Defined Extractor
public override IEnumerable<IRow> Extract(IUnstructuredReader input, IUpdatableRow output)
{
string line;
//Read the input line by line
foreach (Stream current in input.Split(_row_delim))
{
using (StreamReader streamReader = new StreamReader(current, this._encoding))
{
line = streamReader.ReadToEnd().Trim();
LogRowParser splitter = new LogRowParser();
LogRowElements parts = new LogRowElements();
parts = splitter.ParseElements(line);
// ...
yield return output.AsReadOnly();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment