spark临时表导入hive出现null

Dataset<Row> json = sparkSession.read().json(lines);

//创建临时表

json.createOrReplaceTempView("temp");
sparkSession.sql("select * from temp").show()

//将临时表数据写入hive
sparkSession.sql("create  table fs as select * from temp");

temp表查看是有数的

可是查看fs表的时候,有的字段不规律地出现null,甚至有时值会变成字段本身,请教各位,这是什么原因呢?

posted @ 2020-01-03 16:53  hellowzc  阅读(773)  评论(1)    收藏  举报