Spark SQL Json文件存储-------------------------------------------df.write.json("file://home/centos/json")val df = spark.read.json("file://home/centos/json")parquet:文件格式-------------------------------------------df.write.parquet("file://home/centos/json")val df = spark.read.parquet("file://home/centos/json")jdbc交换外部数据源-------------------------------------------//1. val df = spark.read.format("jdbc").option("url", "jdbc:mysql://192.168.231.1:3306/big5").option("dbtable", "customers").option("user", "root").option("password", "root").load() //2. val prop = new java.util.Properties() prop.put("user", "root") prop.put("password", "root") prop.put("driver", "com.mysql.jdbc.Driver") val df = spark.read.jdbc("jdbc:mysql://192.168.231.1:3306/big5", "customers", prop) df.write.format("jdbc").option("url", "jdbc:mysql://192.168.231.1:3306/big5").option("dbtable", "customers").option("user", "root").option("password", "root").save()