You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2018/11/04 06:59:00 UTC
[jira] [Resolved] (SPARK-25638) Convert structs to CSV strings
[ https://issues.apache.org/jira/browse/SPARK-25638?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon resolved SPARK-25638.
----------------------------------
Resolution: Fixed
Fix Version/s: 3.0.0
Issue resolved by pull request 22626
[https://github.com/apache/spark/pull/22626]
> Convert structs to CSV strings
> ------------------------------
>
> Key: SPARK-25638
> URL: https://issues.apache.org/jira/browse/SPARK-25638
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 2.4.0
> Reporter: Maxim Gekk
> Assignee: Maxim Gekk
> Priority: Minor
> Fix For: 3.0.0
>
>
> New function to_csv() should convert a column of StructType to a column with CSV string. The function should accept the CSV options as CSV data source does. API should expose the following methods:
> {code:scala}
> def to_csv(e: Column, options: Map[String, String]): Column
> {code}
> and for Python/R:
> {code:scala}
> def to_csv(e: Column, options: java.util.Map[String, String]): Column
> {code}
> Here is an example of usage:
> {code:sql}
> select to_csv(named_struct('time', to_timestamp('2015-08-26', 'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy'));
> {code}
> {code}
> 26/08/2015
> {code}
--
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