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

Apache Spark reassigned SPARK-16006:
------------------------------------

    Assignee:     (was: Apache Spark)

> Attemping to write empty DataFrame with no fields throw non-intuitive 
> exception
> -------------------------------------------------------------------------------
>
>                 Key: SPARK-16006
>                 URL: https://issues.apache.org/jira/browse/SPARK-16006
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Tathagata Das
>            Priority: Minor
>
> Attempting to write an emptyDataFrame created with 
> {{sparkSession.emptyDataFrame.write.text("p")}} fails with the following 
> exception
> {code}
> org.apache.spark.sql.AnalysisException: Cannot use all columns for partition 
> columns;
>   at 
> org.apache.spark.sql.execution.datasources.PartitioningUtils$.validatePartitionColumn(PartitioningUtils.scala:355)
>   at 
> org.apache.spark.sql.execution.datasources.DataSource.write(DataSource.scala:435)
>   at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:213)
>   at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:196)
>   at org.apache.spark.sql.DataFrameWriter.text(DataFrameWriter.scala:525)
>   ... 48 elided
> {code}
> This is because # fields == # partitioning columns  = 0 at 
> org.apache.spark.sql.execution.datasources.PartitioningUtils$.validatePartitionColumn(PartitioningUtils.scala:355).
>  This is a non-intuitive error message. Better error message "Cannot write 
> dataset with no fields".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to