Scala withColumn新建NULL列

df.withColumn("Test", lit(null)).show()
+----+--------+-----+----+
|Hour|Category|Value|Test|
+----+--------+-----+----+
|   0|   cat26| 30.9|null|
|   1|   cat67| 28.5|null|
|   2|   cat56| 39.6|null|
|   3|    cat8| 35.6|null|
+----+--------+-----+----+

 

posted @ 2021-06-23 18:51  船长博客  阅读(240)  评论(0编辑  收藏  举报
永远相信美好的事情即将发生!