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

Wenchen Fan resolved SPARK-17393.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.1.0

Issue resolved by pull request 14954
[https://github.com/apache/spark/pull/14954]

> Error Handling when CTAS Against the Same Data Source Table Using Overwrite 
> Mode
> --------------------------------------------------------------------------------
>
>                 Key: SPARK-17393
>                 URL: https://issues.apache.org/jira/browse/SPARK-17393
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.1.0
>            Reporter: Xiao Li
>             Fix For: 2.1.0
>
>
> When we trying to read a table and then write to the same table using the 
> `Overwrite` save mode, we got a very confusing error message:
> For example, 
> {noformat}
>       Seq((1, 2)).toDF("i", "j").write.saveAsTable("tab1")
>       table("tab1").write.mode(SaveMode.Overwrite).saveAsTable("tab1")
> {noformat}
> {noformat}
> Job aborted.
> org.apache.spark.SparkException: Job aborted.
>       at 
> org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelationCommand$$anonfun$run$1.apply$mcV$sp
> ...
> Caused by: org.apache.spark.SparkException: Task failed while writing rows
>       at 
> org.apache.spark.sql.execution.datasources.DefaultWriterContainer.writeRows(WriterContainer.scala:266)
>       at 
> org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelationCommand$$anonfun$run$1$$anonfun$apply$mcV$sp$1.apply(InsertIntoHadoopFsRelationCommand.scala:143)
>       at org.apache.spark.sql.execution.datasources
> {noformat}
> After the PR, we will issue an `AnalysisException`:
> {noformat}
> Cannot overwrite table `tab1` that is also being read from
> {noformat}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to