Writing to Delta Table with Spark 3 (much easier!)

.writeTo actually creates (lots of overloads available) a delta table in the correct database and location, no parameters are required.

val df = spark.sparkContext.parallelize(Seq(
  (1, "one"),
  (2, "two")
)).toDF("id", "name")

df.writeTo("shared.idname").createOrReplace()


To contact me, send an email anytime or leave a comment below.