Spark dataframe filter

前端 未结 4 1860
再見小時候
再見小時候 2021-02-07 06:54
val df = sc.parallelize(Seq((1,\"Emailab\"), (2,\"Phoneab\"), (3, \"Faxab\"),(4,\"Mail\"),(5,\"Other\"),(6,\"MSL12\"),(7,\"MSL\"),(8,\"HCP\"),(9,\"HCP12\"))).toDF(\"c1\"         


        
4条回答
  •  醉梦人生
    2021-02-07 07:26

    val df1 = df.filter(not(df("c2").rlike("MSL"))&¬(df("c2").rlike("HCP")))

    This worked.

提交回复
热议问题