我正在尝试将 pyspark 数据帧(百万行)写入 TIDB,(Spark 2.3)
df.write.format('jdbc').options(
url='jdbc:mysql://<host>:<port>/<table>',
driver='com.mysql.jdbc.Driver',
dbtable='<tablename>',
user='<username>',
password='<password>',
batchsize = 30000,
truncate = True
).mode('overwrite').save()
但是,我一直得到的只是这个错误
Caused by: java.sql.BatchUpdateException: statement count 5001 exceeds the transaction limitation, autocommit = false
....
....
....
Caused by: java.sql.SQLException: statement count 5001 exceeds the transaction limitation, autocommit = false
知道如何解决这个问题吗?