Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11347#discussion_r54321647
  
    --- Diff: python/pyspark/sql/dataframe.py ---
    @@ -859,14 +905,20 @@ def filter(self, condition):
             [Row(age=5, name=u'Bob')]
             >>> df.where("age = 2").collect()
             [Row(age=2, name=u'Alice')]
    +
    +        >>> df.filter(lambda row: row.age > 3).collect()
    +        [Row(age=5, name=u'Bob')]
    +        >>> df.map(lambda row: row.age).filter(lambda age: age > 
3).collect()
    +        [5]
             """
             if isinstance(condition, basestring):
    -            jdf = self._jdf.filter(condition)
    +            return DataFrame(self._jdf.filter(condition), self.sql_ctx)
    --- End diff --
    
    DataFrame always have a schema(we have a default), the difference is: a 
DataFrame with default schema has custom objects as records, other DataFrames 
has rows as records.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to