4

I have external hive table created :

create external table test(
b string,
a string
)

My spark code :

case class Test(a:String,b:String)
val list = Seq("bv","av")).toDF
list.write.mode(SaveMode.Append).saveAsTable("test")

The result "bv" is saved into a and "av" is saved into b column (it should be bv -> b and av -> a) . It seems columns ordering matter here when using saveAsTable with append mode?

I'm using spark 1.6.2 version.

NoodleX
  • 709
  • 1
  • 7
  • 21

0 Answers0