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

[jira] [Resolved] (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 ]

Hyukjin Kwon resolved SPARK-24749.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 2.4.0

Issue resolved by pull request 21724
[https://github.com/apache/spark/pull/21724]

> 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
>            Assignee: Liang-Chi Hsieh
>            Priority: Major
>             Fix For: 2.4.0
>
>
> 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