Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-33507 Improve and fix cache behavior in v1 and v2
  3. SPARK-34027

ALTER TABLE .. RECOVER PARTITIONS doesn't refresh cache

Attach filesAttach ScreenshotVotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.1, 3.1.0, 3.2.0
    • Fix Version/s: 3.0.2, 3.1.1, 3.2.0
    • Component/s: SQL
    • Labels:

      Description

      Here is the example to reproduce the issue:

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

      Add new partition by copying the existing one:

      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
      

       Recover and select the table:

      spark-sql> alter table tbl recover partitions;
      spark-sql> select * from tbl;
      0	0
      

      We see only old data.

        Attachments

          Activity

            People

            • Assignee:
              maxgekk Max Gekk
              Reporter:
              maxgekk Max Gekk

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment