1. Problem performance
First of all, the import error is reported because the corresponding jar package is not imported, and a certain library is missing.
After finding it, you need to add the library and jar package to the current project, so that the import xxx in the code can be imported normally
Two, the solution
1. Go to apache (click here to enter directly) official website to download apache.spark
2. Open the IDEA software
and click File——>Project Structure——>Modules——>Dependencies
3. Click on the right +
, select Jars or directory, select the downloaded Jar package, click OK, and then check the newly added jars package, click OK.
3. Effect display
After importing the jar package, no error is displayed: