Home > other >  The import spark. Implicits. _ can't import
The import spark. Implicits. _ can't import

Time:10-08

Novice small white help ~
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 be

CodePudding user response:

In the eclipse on a single run, did not open the hadoop and spark, set up the conf to local mode

CodePudding 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 run

CodePudding 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 can
Officials in Saprk SQL SparkSession. Scala for the import instructions are included in the source code

CodePudding user response:

refer to 6th floor Hector ink reply:
, after created SparkSession to import again can
Officials in Saprk SQL SparkSession. Scala source code for the import of description

Thank you for your bosses
  • Related