You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2016/07/17 07:52:20 UTC
[jira] [Resolved] (SPARK-16585) Update inner fields of complex
types in dataframes
[ https://issues.apache.org/jira/browse/SPARK-16585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sean Owen resolved SPARK-16585.
-------------------------------
Resolution: Invalid
> Update inner fields of complex types in dataframes
> --------------------------------------------------
>
> Key: SPARK-16585
> URL: https://issues.apache.org/jira/browse/SPARK-16585
> Project: Spark
> Issue Type: Question
> Components: Build
> Affects Versions: 1.6.0
> Environment: spark 1.6.0
> scala 2.11
> hive 0.13
> Reporter: Naveen
> Priority: Minor
>
> Using dataframe.withColumn(<colname>,udf($colname)) for inner fields in struct/complex datatype, results in a new dataframe with the a new column appended to it. "colname" in the above argument is given as fullname with dot notation to access the struct/complex fields.
> For eg: hive table has columns: (id int, address struct<line1: struct< buildname:string, stname:string>>, line2:string>)
> I need to update the inner field 'buildname'. I can select the inner field through dataframe as : df.select($"address.line1.buildname"), however when I use df.withColumn("address.line1.buildname", toUpperCaseUDF($"address.line1.buildname")), it is resulting in a new dataframe with new column: "address.line1.buildname" appended, with toUpperCaseUDF values from inner field buildname.
> How can I update the inner fields of the complex data types.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org