import org.apache.spark.sql.functions.{col, monotonically_increasing_id}
df.withColumn("id",monotonically_increasing_id()).show(1000)
spark 添加自增id
最新推荐文章于 2024-01-22 11:25:21 发布
import org.apache.spark.sql.functions.{col, monotonically_increasing_id}
df.withColumn("id",monotonically_increasing_id()).show(1000)