📜  屏蔽函数 pyspark - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:45.630000             🧑  作者: Mango

代码示例1
val df = ss.sparkContext.parallelize( Seq (
  ("c1", "JAN-2017", 49 ),
  ("c1", "MAR-2017", 83),
)).toDF("city", "month", "sales")
df.show()

val mask = udf( (s : String) => {
  "*** Masked ***"
})

df.withColumn("city", mask($"city")).show`