You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Prashant Bhardwaj <pr...@gmail.com> on 2016/05/16 11:58:05 UTC
Renaming nested columns in dataframe
Hi
How can I rename nested columns in dataframe through scala API? Like
following schema
> |-- site: struct (nullable = false)
>
> | |-- site_id: string (nullable = true)
>
> | |-- site_name: string (nullable = true)
>
> | |-- site_domain: string (nullable = true)
>
> | |-- site_cat: array (nullable = true)
>
> | | |-- element: string (containsNull = false)
>
> | |-- publisher: struct (nullable = false)
>
> | | |-- site_pub_id: string (nullable = true)
>
> | | |-- site_pub_name: string (nullable = true)
>
I want to change it to
> |-- site: struct (nullable = false)
>
> | |-- id: string (nullable = true)
>
> | |-- name: string (nullable = true)
>
> | |-- domain: string (nullable = true)
>
> | |-- cat: array (nullable = true)
>
> | | |-- element: string (containsNull = false)
>
> | |-- publisher: struct (nullable = false)
>
> | | |-- id: string (nullable = true)
>
> | | |-- name: string (nullable = true)
>
>
Regards
Prashant