I'm trying to read something from a Database table using JDBC:
val df = spark.read.jdbc("<database url>", "<some table name>", <some DbProperties>)
and then write it to another database:
df.write.mode(SaveMode.Append).jdbc("<other database url>", "<same table name>", <some DbProperties>)
- If we do not specify
numPartitions
option in the Db Properties, what will be the default value fornumPartitions
Spark uses to read the table from Database intodf
? - If I want to write the above
df
into another table of another database, if I still don't specifynumPartitions
, will there be parallel connections created while writing to the Database? - Suppose while reading I have given
numPartitions
as 8, while writing thisdf
onto the target DB, will thenumPartitions = 8
still be valid without me explicitly specifying it while writing?