You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2018/07/06 07:30:00 UTC

[jira] [Assigned] (SPARK-24749) Cannot filter array with named_struct

     [ https://issues.apache.org/jira/browse/SPARK-24749?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Apache Spark reassigned SPARK-24749:
------------------------------------

    Assignee:     (was: Apache Spark)

> 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
>            Priority: Major
>
> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org