Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5839#discussion_r29536701
  
    --- Diff: python/pyspark/sql/dataframe.py ---
    @@ -1289,6 +1289,18 @@ def cast(self, dataType):
                 raise TypeError("unexpected type: %s" % type(dataType))
             return Column(jc)
     
    +    @ignore_unicode_prefix
    +    def between(self, col1, col2):
    +        """ A boolean expression that is evaluated to true if the value of 
this
    +        expression is between the given columns.
    +
    +        >>> df[df.col1.between(col2, col3)].collect()
    +        [Row(col1=5, col2=6, col3=8)]
    +        """
    +        #sc = SparkContext._active_spark_context
    +        jc = self > col1 & self < col2
    --- End diff --
    
    i think u need to add parenthesis, i.e. (self > col1) & (self < col2)


---
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