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

Hyukjin Kwon resolved SPARK-34055.
----------------------------------
    Resolution: Fixed

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

> ALTER TABLE .. ADD PARTITION doesn't refresh cache
> --------------------------------------------------
>
>                 Key: SPARK-34055
>                 URL: https://issues.apache.org/jira/browse/SPARK-34055
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.1, 3.1.0, 3.2.0
>            Reporter: Maxim Gekk
>            Assignee: Apache Spark
>            Priority: Major
>              Labels: correctness
>             Fix For: 3.2.0
>
>
> Here is the example to reproduce the issue:
> {code:sql}
> spark-sql> create table tbl2 (col int, part int) partitioned by (part);
> spark-sql> insert into tbl2 partition (part=0) select 0;
> spark-sql> cache table tbl2;
> spark-sql> select * from tbl2;
> 0     0
> spark-sql> show table extended like 'tbl2' partition (part = 0);
> default       tbl2    false   Partition Values: [part=0]
> Location: 
> file:/Users/maximgekk/proj/add-partition-refresh-cache-2/spark-warehouse/tbl2/part=0
> ...
> {code}
> Add new partition by copying the existing one:
> {code}
> cp -r 
> /Users/maximgekk/proj/add-partition-refresh-cache-2/spark-warehouse/tbl2/part=0
>  
> /Users/maximgekk/proj/add-partition-refresh-cache-2/spark-warehouse/tbl2/part=1
> {code}
>  Add new partition and select the table:
> {code}
> spark-sql> alter table tbl2 add partition (part = 1) location 
> '/Users/maximgekk/proj/add-partition-refresh-cache-2/spark-warehouse/tbl2/part=1';
> spark-sql> select * from tbl2;
> 0     0
> {code}
> We see only old data.



--
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