spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wenchen Fan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-15315) CSV datasource writes garbage for complex types instead of rasing error.
Date Tue, 24 May 2016 00:19:15 GMT

     [ https://issues.apache.org/jira/browse/SPARK-15315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Wenchen Fan updated SPARK-15315:
--------------------------------
    Assignee:     (was: Wenchen Fan)

> CSV datasource writes garbage  for complex  types instead of rasing error. 
> ---------------------------------------------------------------------------
>
>                 Key: SPARK-15315
>                 URL: https://issues.apache.org/jira/browse/SPARK-15315
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Suresh Thalamati
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> Complex types support does not seem to exist yet for csv writer.  Error should be raised
instead of writing garbage into the files. 
> Read throw error java.lang.RuntimeException: Unsupported type: map 
> Repro:
> {code}
> Seq((1, Map("Tesla" -> 3))).toDF("id", "cars").write.csv("/tmp/output")
> cat part-r-00007-f684166f-ac28-48a1-99dc-1bb2c2ef1164.csv
> 1,org.apache.spark.sql.catalyst.expressions.UnsafeMapData@6d10824e
> Seq((1, Array("Tesla"))).toDF("id", "cars").write.mode("overwrite").csv("/tmp/output")
> cat part-r-00007-5bc39b53-25b6-4802-a98d-ec0cbd0e189a.csv 
> 1,org.apache.spark.sql.catalyst.expressions.UnsafeArrayData@a7e180b5
> scala> Seq((1, "Tesla")).toDF("id", "name").select(struct("id", "name")).write.mode("overwrite").csv("/tmp/output")
> cat part-r-00007-e0c688e1-e04d-4fa0-baf9-31183871ef6d.csv 
> "[0,1,1800000005,616c736554]"
> {code}



--
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


Mime
View raw message