spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-24749) Cannot filter array<struct> with named_struct
Date Fri, 06 Jul 2018 07:30:00 GMT

    [ https://issues.apache.org/jira/browse/SPARK-24749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16534523#comment-16534523
] 

Apache Spark commented on SPARK-24749:
--------------------------------------

User 'viirya' has created a pull request for this issue:
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
>            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


Mime
View raw message