I have a dataframe that contains a Boolean column (TRUE,FALSE,NULL). When i send this dataframe to an existing table in Oracle 19c using Spark2 Scala jdbc, it FAILS with the error : java.sql.SQLException: Invalid column type: 16.
But, when they aren't a NULL values in the dataframe, the task is accomplished as successfully. In addition, if I insert a NULL value into the Boolean field directly in Oracle, i have no problem (this is just for testing NULL value directly in Oracle).
The way that I write the Data in Oracle Using Spark is :
df.write.mode(SaveMode.Append).jdbc(url, tableName, connectionProperties)
DataFrame that i can write in Oracle:
val df = Seq(("d1",TRUE), ("d2",FALSE)).toDF("firstColumn","secondColumn")
DataFrame that I can't write in Oracle :
val df = Seq(("d1",TRUE), ("d2",FALSE),("d3",null)).toDF("fistColumn","secondColumn")
And here is some information about the destination column in Oracle :
- DataType : NUMBER(1,0)
- NULLABLE : YES
- Data_Default : (null)

