Oleg Danilov created SPARK-14990:
------------------------------------

             Summary: nvl, coalesce, array functions with parameter of type 
"array"
                 Key: SPARK-14990
                 URL: https://issues.apache.org/jira/browse/SPARK-14990
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 1.6.1
            Reporter: Oleg Danilov
            Priority: Minor


Steps to reproduce:

1. create table tmp(col1 int, col2 array<int>)
2. insert values:

{code}
  1, [1]
  2, [2]
  3, NULL
{code}

3. run query 

select col1, coalesce(col2, array(1,2,3)) from tmp;

Expected result:

{code}
1, [1]
2, [2]
3, [1,2,3]
{code}

Current result:

{code}
Error: org.apache.spark.sql.AnalysisException: cannot resolve 
'coalesce(col2,array(1,2,3))' due to data type mismatch: input to function 
coalesce should all be the same type, but it's [array<int>, array<int>]; line 1 
pos 38 (state=,code=0)
{code}

The fix seems to be pretty easy, will create a PR soon.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to