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

David Lindelöf updated SPARK-30305:
-----------------------------------
    Attachment: pyspark.out

> Unable to overwrite table created by another Spark session
> ----------------------------------------------------------
>
>                 Key: SPARK-30305
>                 URL: https://issues.apache.org/jira/browse/SPARK-30305
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 2.4.4
>            Reporter: David Lindelöf
>            Priority: Major
>         Attachments: pyspark.out
>
>
> I'm unable to save a dataframe to a table, even when passing the 
> `mode='overwrite'` argument:
>  
> {code:java}
> def test_pyspark_can_overwrite_table():
>     spark = SparkSession.builder.getOrCreate()
>     sdf = spark.createDataFrame([('Alice', 1)])
>     sdf.write.saveAsTable('alice')
>     spark.stop()
>     spark = SparkSession.builder.getOrCreate()
>     sdf = spark.createDataFrame([('Alice', 1)])
>     sdf.write.saveAsTable('alice', mode='overwrite')
> {code}
> I would expect this to succeed. Instead, I get the output in the attached 
> file.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to