[
https://issues.apache.org/jira/browse/SPARK-16006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15335324#comment-15335324
]
Dongjoon Hyun commented on SPARK-16006:
---------------------------------------
I will fix this tonight~
Thank you for reporting this, [~tdas].
> 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: [email protected]
For additional commands, e-mail: [email protected]