Databricks 错误:org.postgresql.util.PSQLException:不支持身份验证类型 10

时间:2021-07-28 08:37:48

标签: postgresql jdbc pyspark connection databricks

目前,我在 Databricks 上使用带有选项 jdbc 的 spark 运行代码以连接到 postgresql 以获取数据。 PostgreSQL 版本 42.1.4,Databricks 运行时 8.3

这是我的代码,我想隐藏数据库信息:

df = (spark\
  .read\
  .format("jdbc")\
  .option("url", "jdbc:postgresql://postgres.*******:5432/dbname?user=*******&password=******")\
  .option("dbtable", "schema.table_name")\
  .option("driver", "org.postgresql.Driver")\
  .load()
)
df.printSchema()

这是我得到的错误:

org.postgresql.util.PSQLException: The authentication type 10 is not supported. Check that you have configured the pg_hba.conf file to include the client's IP address or subnet, and that it is using an authentication scheme supported by the driver.

但是,我无法在 Databricks 上找到解决此问题的方法

我希望你能帮助我修复 Databricks 上的这个错误

Error

0 个答案:

没有答案