原始数据
zhang san,15
li si,15
wang wu,20
zhao liu,22
zhang san,42
li wu,22
li si,20
hello world,18
hello world,18
/**
* 从文本文件中创建Person对象的RDD,将其转换为Dataframe
*/
@Test
def test4(): Unit ={
val ss: SparkSession = SparkSession.builder().appName("Spark SQL basic example")
.config("spark.some.config.option", "some-value").getOrCreate()
import ss.implicits._
//从文本文件中创建Person对象的RDD,将其转换为Dataframe
val personDF: DataFrame = ss<