GitHub user chongguang opened a pull request:

    https://github.com/apache/spark/pull/21581

    [SPARK-24574][SQL] array_contains function deals with Column type

    ## What changes were proposed in this pull request?
    
    For the function ```def array_contains(column: Column, value: Any): Column 
``` , if we pass the `value` parameter as a Column type, it will yield a 
runtime exception.
    
    This PR proposes a pattern matching to detect if `value` is of type Column. 
If yes, it will use the .expr of the column, otherwise it will work as it used 
to.
    
    ## How was this patch tested?
    
    Unit test modified to cover this code change.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chongguang/spark SPARK-24574

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/21581.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #21581
    
----
commit 27733f9ad56657925c176ae394114e0429aa9a0b
Author: Chongguang LIU <chong@...>
Date:   2018-06-17T18:17:15Z

    array_contains function deals with Column type for the second parameter.

commit 28aa51554f4c730fae3c8090ac3c268e1ddfa4f8
Author: Chongguang LIU <chong@...>
Date:   2018-06-17T19:58:57Z

    add unit test for Column type

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to