I am reading in some data from a json file and converting it to a string that I use to send my data to hive.
The data is arriving fine in Hive, but it gets distributed in to the wrong columns, I have made a small example
in Hive:
Table name = TestTable, Column1 = test1, Column2 = test2`
My code:
data = hiveContext.sql("select \"hej\" as test1, \"med\" as test2")
data.write.mode("append").saveAsTable("TestTable")
data = hiveContext.sql("select \"hej\" as test2, \"med\" as test1")
data.write.mode("append").saveAsTable("TestTable")
this results in "hej" showing up in test1 both times and "med" showing up in test2 both times, instead of one showing up in each.
It always just seems to show up in the order written and not go in to the mentioned columns that I mention with the 'as' keyword.
Any one have any ideas?