You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2018/10/04 09:44:00 UTC
[jira] [Commented] (SPARK-25638) Convert structs to CSV strings
[ https://issues.apache.org/jira/browse/SPARK-25638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16637993#comment-16637993 ]
Apache Spark commented on SPARK-25638:
--------------------------------------
User 'MaxGekk' has created a pull request for this issue:
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
> Priority: Minor
>
> 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