[Solved] Spark Writer tidb Error: read-uncommitted is not supported

Error Log:
Caused by: java.sql.SQLException: The isolation level ‘READ-UNCOMMITTED’ is not supported. Set tidb_skip_isolation_level_check=1 to skip this error

Solution:

val tidb_url = ""//Fill in your own tidb url
val table_name = "aa"//the tidb table to insert
val properties = new Properties()
properties.setProperty("user","username") properties.setProperty("password","123456")
sparkSession.sql("select * from table").write.mode(SaveMode.Append).option("isolationLevel","NONE").jdbc(tidb_url,table_name,properties)

Read More: