ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

pyspark添加一列时间戳数据并改名

pyspark添加一列时间戳数据并改名
df.withColumn("create_time",current_timestamp()).withColumnRenamed("count","browse_count")

参考

  • pyspark.sql.DataFrame.withColumns
  • pyspark.sql.DataFrame.withColumnRenamed
  • pyspark.sql.functions.current_timestamp
返回列表