08-21-2018 01:54 AM
The Scala code in this exercise does not compile:
I get the error:
<console>:30: error: not found: value sc
Where is the variable 'sc' initialized? There are many errors in these tutorials which is a bit frustrating, I hope someone can tell me how to overcome it, thanks.
I am running the latest CDH Quickstart docker image.
08-21-2018 04:32 AM
You have to initialize sc depends upon how you are executing your code. If you are using spark-shell command line then you don't need to initilize sc as it will be initialized by default when you login but if you are developing code in other 3rd party tools and executing then you have to initilialize as follows:
You can add the below lines before you call rddFromParquetHdfsFile
val conf = new SparkConf().setAppName("your topic").setMaster("yarn-client")
val sc = new SparkContext(conf)