spark 写postgresql:org.postgresql.util.PSQLException: ERROR: column "info" is of type jsonb but expre

error:org.postgresql.util.PSQLException: ERROR: column "info" is of type jsonb but expression is of type character varying

当写入jsonb类型数据时,报错

解决:

df.write .format("jdbc")
  .option("url", "jdbc:postgresql://10.0.10.XX:5432/postgres")
  .option("dbtable", "nt_order1")
  .option("stringtype", "unspecified"*)*
  .option("user", "XXXX")
  .option("password", "XXXXX").mode(SaveMode.Append)
  .save()

添加参数:*  .*option("stringtype""unspecified"*)*

你可能感兴趣的:(spark)