spark dataframe增加一列

使用任意的值(可以是df中存在的列值,也可以是不存在的)增加一列

      .withColumn("last_update_time", lit(DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")))
      .withColumn("t_start", col = concat(frame_result("dt"), lit(" "), frame_result("dh"), lit(":00:00")))

 

你可能感兴趣的:(大数据,spark)