spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "pin_zhang (JIRA)" <>
Subject [jira] [Created] (SPARK-24749) Cannot filter array<struct> with named_struct
Date Fri, 06 Jul 2018 05:55:00 GMT
pin_zhang created SPARK-24749:

             Summary: Cannot filter array<struct> with named_struct
                 Key: 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

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

View raw message