Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@carlsverre
Created December 11, 2015 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlsverre/ebbfcd3562a0aba8a3b0 to your computer and use it in GitHub Desktop.
Save carlsverre/ebbfcd3562a0aba8a3b0 to your computer and use it in GitHub Desktop.
JavaRDD<String> inputFile = sparkContext.textFile(filePath, minPartitions).toJavaRDD();
JavaRDD<byte[]> bytes = inputFile.map(new Function<String, byte[]>(){
@Override
public byte[] call(String str) {
return ByteUtils.utf8StringToBytes(str);
}
});
return Option$.MODULE$.apply(JavaRDD.toRDD(bytes));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment