A quick exercise to easily load a csv file with header, into an oracle table, using spark ( spark session created when launching spark-shell )
val prop = new java.util.Properties
prop.setProperty("user","username")
prop.setProperty("password","password")
prop.setProperty("user","username")
prop.setProperty("password","password")
val vd = spark.read.option("header", "true").option("quote","'").option("escape","^").csv("file:///C:/tmp/test.csv")
vd.write.mode("overwrite").jdbc("jdbc:oracle:thin:@host:port/SID","table_name",prop)
Comments
Post a Comment