Install
- Download & uncompressed jdk
set the environment variables of java
123456export JAVA_HOME=/home/automation/java/jdk1.8.0_161export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:.export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATHexport SBT_HOME=/home/automation/spark/sbt/sbtexport SPARK_HOME=/home/automation/spark/spark-2.2.1-bin-hadoop2.7export PATH=$PATH:$SBT_HOME/bin:$SPARK_HOME/binDownload & uncompressed spark
- set the environment variables of spark
- install sbt: used to build scala
Doc
- 打开命令行交互
dataset的构造函数中传入输入文件,调用dataset的[API处理文档](https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.Dataset) - 编写可运行的文件