input - sc.textFile scala error -
i trying read file path i've written file at. following documentation using following line of code:
val data = sc.textfile(path)
this give compilation error: not found: value sc.
i found solutions involve commands should given in terminal, in case using eclipse. there way resolve issue importing library or this?
thank you!
you need create spark context first.
for example:
val conf = new sparkconf().setappname(appname).setmaster(master) val sc = new sparkcontext(conf)
when using spark shell there no need create spark context, because created you, in variable called sc.
you can read more spark context initialization there.
Comments
Post a Comment