DataFrame条件查询,filter,where算子

亲测可用 字符串类型过滤 people.filter(" gender = 'male' ").count people.filter(" gender != 'female' ").count 或者 people.filter($"gender"==="male").count people.filter($"gender" !== "female").count数值类型过滤 people.filter($"age" > 25).show people.filter(" age > 25 ").show 或者 people.where($"age" > 25).show people.where("age>25").show people.where($"age" > 25 && $"gender" === "male").show

    推荐阅读