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

Apache Spark commented on SPARK-34027:
--------------------------------------

User 'MaxGekk' has created a pull request for this issue:
https://github.com/apache/spark/pull/31309

> ALTER TABLE .. RECOVER PARTITIONS doesn't refresh cache
> -------------------------------------------------------
>
>                 Key: SPARK-34027
>                 URL: https://issues.apache.org/jira/browse/SPARK-34027
>             Project: Spark
>          Issue Type: Sub-task
>          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.0.2, 3.2.0, 3.1.2
>
>
> Here is the example to reproduce the issue:
> {code:sql}
> spark-sql> create table tbl (col int, part int) using parquet partitioned by 
> (part);
> spark-sql> insert into tbl partition (part=0) select 0;
> spark-sql> cache table tbl;
> spark-sql> select * from tbl;
> 0     0
> spark-sql> show table extended like 'tbl' partition(part=0);
> default       tbl     false   Partition Values: [part=0]
> Location: 
> file:/Users/maximgekk/proj/recover-partitions-refresh-cache/spark-warehouse/tbl/part=0
> ...
> {code}
> Add new partition by copying the existing one:
> {code}
> cp -r 
> /Users/maximgekk/proj/recover-partitions-refresh-cache/spark-warehouse/tbl/part=0
>  
> /Users/maximgekk/proj/recover-partitions-refresh-cache/spark-warehouse/tbl/part=1
> {code}
>  Recover and select the table:
> {code}
> spark-sql> alter table tbl recover partitions;
> spark-sql> select * from tbl;
> 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