I want to read data from an Oracle DB using Spark JDBC in a specific charset encoding like us-ascii but I am unable to.
The code I tried as per this answer:
val res=spark.read.format("jdbc")
.option("url", url)
.option("user", "userid")
.option("password", "pwd")
.option("driver","oracle.jdbc.OracleDriver")
.option("encoding", "us-ascii")
.option("characterEncoding", "us-ascii")
.option("query", tableQuery).option("fetchsize","10000")
.load()
This always returns the data in utf-8 encoding.
Is there a way to achieve this?