Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D615C200C43 for ; Sun, 26 Mar 2017 08:27:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D4AF2160B87; Sun, 26 Mar 2017 06:27:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 25DD7160B77 for ; Sun, 26 Mar 2017 08:27:14 +0200 (CEST) Received: (qmail 14289 invoked by uid 500); 26 Mar 2017 06:27:14 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 14278 invoked by uid 99); 26 Mar 2017 06:27:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Mar 2017 06:27:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 01A69DFF32; Sun, 26 Mar 2017 06:27:14 +0000 (UTC) From: HyukjinKwon To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request #17429: [MINOR][DOCS] Match several documentation changes... Content-Type: text/plain Message-Id: <20170326062714.01A69DFF32@git1-us-west.apache.org> Date: Sun, 26 Mar 2017 06:27:14 +0000 (UTC) archived-at: Sun, 26 Mar 2017 06:27:16 -0000 Github user HyukjinKwon commented on a diff in the pull request: https://github.com/apache/spark/pull/17429#discussion_r108052897 --- Diff: python/pyspark/sql/functions.py --- @@ -1675,15 +1675,18 @@ def array(*cols): @since(1.5) 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 the + 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']) >>> df.select(array_contains(df.data, "a")).collect() [Row(array_contains(data, a)=True), Row(array_contains(data, a)=False)] + >>> df = spark.createDataFrame([(["1", "2", "3"],), ([],)], ['data']) + >>> df.select(array_contains(df.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 https://github.com/apache/spark/pull/17429#discussion_r108030625 --- 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 infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org For additional commands, e-mail: reviews-help@spark.apache.org