You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Lauri Koobas (Jira)" <ji...@apache.org> on 2020/09/08 08:09:00 UTC

[jira] [Updated] (SPARK-32819) Spark SQL aggregate() fails on nested string arrays

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

Lauri Koobas updated SPARK-32819:
---------------------------------
    Description: 
The aggregate() function seems to fail if the initial state is array(array( some string )). Seems to work if it's an INT for example.

Example that works with a simple array:

{{select aggregate(split('abcdefgh',''), array(''), (acc, x) -> array( x ) )}}

Example that works with nested array and INTs:

{{select aggregate(sequence(0,9), array(array(0)), (acc, x) -> array(array}}{{( x ) ) }}{{)}}

Example that errors:

{{select aggregate(split('abcdefgh',''), array(array('')), (acc, x) -> array(array}}{{( x ) ) }}{{)}}

Producing the following (shortened) error:

{{data type mismatch: argument 3 requires array<array<string>> type, however ... is of array<array<string>> type.}}

 

  was:
The aggregate() function seems to fail if the initial state is array(array( some string )). Seems to work if it's an INT for example.

Example that works with a simple array:

{{select aggregate(split('abcdefgh',''), array(''), (acc, x) -> array(x))}}

Example that works with nested array and INTs:

{{select aggregate(sequence(0,9), array(array(0)), (acc, x) -> array(array(x)))}}

Example that errors:

{{select aggregate(split('abcdefgh',''), array(array('')), (acc, x) -> array(array(x)))}}

Producing the following (shortened) error:

{{data type mismatch: argument 3 requires array<array<string>> type, however ... is of array<array<string>> type.}}

 


> Spark SQL aggregate() fails on nested string arrays
> ---------------------------------------------------
>
>                 Key: SPARK-32819
>                 URL: https://issues.apache.org/jira/browse/SPARK-32819
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.0
>         Environment: Spark 3.0.0 on Databricks (DBR 7.2).
>            Reporter: Lauri Koobas
>            Priority: Minor
>
> The aggregate() function seems to fail if the initial state is array(array( some string )). Seems to work if it's an INT for example.
> Example that works with a simple array:
> {{select aggregate(split('abcdefgh',''), array(''), (acc, x) -> array( x ) )}}
> Example that works with nested array and INTs:
> {{select aggregate(sequence(0,9), array(array(0)), (acc, x) -> array(array}}{{( x ) ) }}{{)}}
> Example that errors:
> {{select aggregate(split('abcdefgh',''), array(array('')), (acc, x) -> array(array}}{{( x ) ) }}{{)}}
> Producing the following (shortened) error:
> {{data type mismatch: argument 3 requires array<array<string>> type, however ... is of array<array<string>> type.}}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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