pin_zhang created SPARK-24749:
---------------------------------

             Summary: Cannot filter array<struct> with named_struct
                 Key: SPARK-24749
                 URL: https://issues.apache.org/jira/browse/SPARK-24749
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.3.1
            Reporter: pin_zhang


1. Create Table

create table arr__int( arr array<struct<a:int>> )stored as parquet;

2. Insert data

insert into arr__int values( array(named_struct('a', 1)));

3. Filter with struct data

select * from arr__int where array_contains (arr, named_struct('a', 1));
Error: org.apache.spark.sql.AnalysisException: cannot resolve 
'array_contains(arr__int.`arr`, named_struct('a', 1))' due to data type 
mismatch: Arguments must be an array followed by a value of same type as the 
array members; line 1 pos 29;
'Project [*]
+- 'Filter array_contains(arr#6, named_struct(a, 1))
 +- SubqueryAlias arr__int
 +- Relation[arr#6] parquet (state=,code=0)

Caused by schema null is always false in named_struct 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to