sql >> Base de Datos >  >> NoSQL >> MongoDB

¿Cómo elimino los tweets vacíos usando filter() en pyspark?

Si tus datos son así

tweets = sc.parallelize(["title1", "", "title2", "title3", ""])

puedes usar len(x) como condición de filtro:

tweets.filter(lambda x: len(x) > 0).count()