sparksql

from pyspark.sql import SparkSession


if __name__ == '__main__':
    spark = SparkSession.builder.appName("Python Spark ").master("local[2]").getOrCreate()
    jdbcDF = spark.read.format("jdbc").option("url", "jdbc:mysql://localhost:3306/video").option("driver","com.mysql.jdbc.Driver").option("dbtable", "baidu").option("user", "root").option("password", "123456").load()
    jdbcDF.show()