Created
November 15, 2016 17:31
-
-
Save kunickiaj/a372c5088bbdb0b767ac4cf464ef8588 to your computer and use it in GitHub Desktop.
SDC JavaScript Key Value Splitter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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