Skip to content

Instantly share code, notes, and snippets.

@kunickiaj
Created November 15, 2016 17:31
Show Gist options
  • Save kunickiaj/a372c5088bbdb0b767ac4cf464ef8588 to your computer and use it in GitHub Desktop.
Save kunickiaj/a372c5088bbdb0b767ac4cf464ef8588 to your computer and use it in GitHub Desktop.
SDC JavaScript Key Value Splitter
for(var i = 0; i < records.length; i++) {
try {
records[i].value = com.google.common.base.Splitter.on(", ").withKeyValueSeparator("=").split(records[i].value['text'])
// Write record to procesor output
output.write(records[i]);
} catch (e) {
// Send record to error
error.write(records[i], e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment