I'm trying to update values using JDBC on spark and I continue to get the same error .
I used the following query
statement.addBatch(("INSERT INTO gasoil_summeries " + "VALUES ("
+ "'" + row.getAs("id_vehicule2")+"'"
+ "'" + row.getInt(0)+"'"
+"'" + row.getAs("litre2")+"'"
+"'" +row.getDouble(1)+"'"
+ "'"+row.getAs("count2")+"'"
+"'" + row.getInt(2)+"'"
+"'" + row.getAs("is_sup2")+"'"
+"'"+row.getInt(3)+"'"
+"'" +row.getAs("last_upd2")+"'"
+"'"+row.getTimestamp(4)+"'"
+") ON DUPLICATE KEY UPDATE _id_vehicule='" + row.getAs("id_vehicule2") + "';"));
the number of columns is the same, but I continue to get the error "java.sql.SQLException: Column count doesn't match value count at row 1"
Thnak you.