Details
Description
When writing a DataFrame that contains empty strings as values to an RDBMS, the query that is generated does not have the correct column count:
CREATE TABLE demo(foo INTEGER, bar VARCHAR(10)); ----- case class Record(foo: Int, bar: String) val data = sc.parallelize(List(Record(1, ""))).toDF data.write.mode("append").jdbc(...)
This causes:
java.sql.SQLException: Column count doesn't match value count at row 1
Proposal: leave empty strings as they are or convert these to NULL (although that may not be what's intended by the user, so make this configurable).