The import spark. Implicits. _ can't import: not found: the object spark
Compiler: eclipse
Version: the spark - 2.1.1 hadoop - 2.7.3 scala2.1.2.2
CodePudding user response:
Wrong number, scala - 2.12.2 scala version should beCodePudding user response:
In the eclipse on a single run, did not open the hadoop and spark, set up the conf to local modeCodePudding user response:
Here is the spark, not the thing in a class should be a variable, as follows:Val spark=SparkSession. Builder (). GetOrCreate ();
The import spark. Implicits. _
The spark. SQL (" ")
CodePudding user response:
Compiled using scala2.11, scala2.12 before I have a question, is can't runCodePudding user response:
To import spark. Implicits. _ the spark is a variable, you need to define this variable, import the corresponding implicits. He _, so this code should not be written on the front, it should be written in a code block,CodePudding user response:
After creating the SparkSession, to import again canOfficials in Saprk SQL SparkSession. Scala for the import instructions are included in the source code
CodePudding user response: