Apache spark Pyspark中的过滤器操作

Apache spark Pyspark中的过滤器操作,apache-spark,pyspark,Apache Spark,Pyspark,我有一个dataframedataframe1,我想从这个dataframe中获得一些过滤记录,我已经成功地对其应用了like和isin操作: dataframe1.where((col('string_v').like("d_ms%"))).show() dataframe1.where((col('string_v').isin("d_ms-92","d_ms_93"))).show() 但是有人能帮助我如何应用过滤条件而不是isin和不喜欢使用pyspark,任何帮助都将不胜感激。 da

我有一个dataframedataframe1,我想从这个dataframe中获得一些过滤记录,我已经成功地对其应用了likeisin操作:

dataframe1.where((col('string_v').like("d_ms%"))).show()
dataframe1.where((col('string_v').isin("d_ms-92","d_ms_93"))).show()
但是有人能帮助我如何应用过滤条件而不是isin不喜欢使用pyspark,任何帮助都将不胜感激。

dataframe1.where(~(col('string_v').like("d_ms%"))).show()
dataframe1.where(~(col('string_v').isin("d_ms-92","d_ms_93"))).show()

或者

from pyspark.sql.functions import not

dataframe1.where(not(col('string_v').like("d_ms%"))).show()
dataframe1.where(not(col('string_v').isin("d_ms-92","d_ms_93"))).show()