spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From HyukjinKwon <>
Subject [GitHub] spark pull request #17429: [MINOR][DOCS] Match several documentation changes...
Date Sun, 26 Mar 2017 06:27:14 GMT
Github user HyukjinKwon commented on a diff in the pull request:
    --- Diff: python/pyspark/sql/ ---
    @@ -1675,15 +1675,18 @@ def array(*cols):
     def array_contains(col, value):
    -    Collection function: returns True if the array contains the given value. The collection
    -    elements and value must be of the same type.
    +    Collection function: returns null if the array is null, true if the array contains
    +    given value, and false otherwise.
         :param col: name of column containing array
         :param value: value to check for in array
         >>> df = spark.createDataFrame([(["a", "b", "c"],), ([],)], ['data'])
         >>>, "a")).collect()
         [Row(array_contains(data, a)=True), Row(array_contains(data, a)=False)]
    +    >>> df = spark.createDataFrame([(["1", "2", "3"],), ([],)], ['data'])
    +    >>>, 1)).collect()
    --- End diff --
    Yea,  the data is string array and the given value is a number. This case is about implicit
casting case. I added this example and removed `The collection elements and value must be
of the same type`. This one is the bit I described in

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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message