0

我想在代码中将 sparksql 与 jdbc 连接起来

   import jaydebeapi

    conn = jaydebeapi.connect('com.simba.spark.jdbc41.Driver',"jdbc:spark://localhost:10000/default;AuthMech=3;SSL=0",{'user': 'spark', 'password': "di6'gnr"},'/hdfs/dev/scripts/pyspark/drivers/SparkJDBC41.jar',)
    curs = conn.cursor()

    curs.execute("select * from CUSTOMER")
    curs.fetchall()

    curs.close()
    conn.close()

在此处输入图像描述

4

0 回答 0