You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Linhong Liu (Jira)" <ji...@apache.org> on 2022/08/31 17:27:00 UTC

[jira] [Created] (SPARK-40292) arrays_zip output unexpected alias column names

Linhong Liu created SPARK-40292:
-----------------------------------

             Summary: arrays_zip output unexpected alias column names
                 Key: SPARK-40292
                 URL: https://issues.apache.org/jira/browse/SPARK-40292
             Project: Spark
          Issue Type: Task
          Components: SQL
    Affects Versions: 3.4.0
            Reporter: Linhong Liu


For the below query:

 
{code:java}
with q as (
  select
    named_struct(
      'my_array', array(named_struct('x', 1, 'y', 2))
    ) as my_struct
)
select
  arrays_zip(my_struct.my_array)
from
  q {code}
The latest spark gives the below schema, the field name "my_array" was changed to "0"

 
root
 |-- arrays_zip(my_struct.my_array): array (nullable = true)
 |    |-- element: struct (containsNull = false)
 |    |    |-- 0: struct (nullable = true)
 |    |    |    |-- x: integer (nullable = true)
 |    |    |    |-- y: integer (nullable = true)
 
But the Spark 3.1 gives expected result
root
 |-- arrays_zip(my_struct.my_array): array (nullable = true)
 |    |-- element: struct (containsNull = false)
 |    |    |-- my_array: struct (nullable = true)
 |    |    |    |-- x: integer (nullable = true)
 |    |    |    |-- y: integer (nullable = true)
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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