[ 
https://issues.apache.org/jira/browse/SPARK-32838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17194326#comment-17194326
 ] 

Dongjoon Hyun commented on SPARK-32838:
---------------------------------------

[~CHENXCHEN] and [~lithiumlee-_-]. Could you try the following?
{code}
spark-sql> select version();
3.0.1 2b147c4cd50da32fe2b4167f97c8142102a0510d
Time taken: 0.053 seconds, Fetched 1 row(s)

spark-sql> set spark.sql.sources.partitionOverwriteMode=DYNAMIC;
spark.sql.sources.partitionOverwriteMode        DYNAMIC
Time taken: 0.043 seconds, Fetched 1 row(s)

spark-sql> insert overwrite table tmp.spark3_snap select id, '2020-09-10' dt 
from tmp.spark3_snap where dt='2020-09-09';
Time taken: 0.605 seconds

spark-sql> select * from tmp.spark3_snap;
10      2020-09-09
10      2020-09-10
Time taken: 0.216 seconds, Fetched 2 row(s)
{code}

> Connot overwite different partition with same table
> ---------------------------------------------------
>
>                 Key: SPARK-32838
>                 URL: https://issues.apache.org/jira/browse/SPARK-32838
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.0
>         Environment: hadoop 2.7 + spark 3.0.0
>            Reporter: CHC
>            Priority: Major
>
> When:
> {code:java}
> CREATE TABLE tmp.spark3_snap (
> id string
> )
> PARTITIONED BY (dt string)
> STORED AS ORC
> ;
> insert overwrite table tmp.spark3_snap partition(dt='2020-09-09')
> select 10;
> insert overwrite table tmp.spark3_snap partition(dt='2020-09-10')
> select 1;
> insert overwrite table tmp.spark3_snap partition(dt='2020-09-10')
> select id from tmp.spark3_snap where dt='2020-09-09';
> {code}
> and it will be get a error: "Cannot overwrite a path that is also being read 
> from"
> related: https://issues.apache.org/jira/browse/SPARK-24194
> This work on spark 2.4.3 and do not work on spark 3.0.0
>   



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

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

Reply via email to