@@ -340,9 +340,11 @@ public Predicate<ExpireFileEntry> createDataFileSkipperForTags(
340340 if (index >= 0 ) {
341341 Snapshot previousTag = taggedSnapshots .get (index );
342342 if (previousTag .id () != cachedTag ) {
343- cachedTag = previousTag . id () ;
343+ cachedTag = 0 ;
344344 cachedTagDataFiles .clear ();
345345 addMergedDataFiles (cachedTagDataFiles , previousTag );
346+ // update cachedTag after read tag successfully
347+ cachedTag = previousTag .id ();
346348 }
347349 return entry -> containsDataFile (cachedTagDataFiles , entry );
348350 }
@@ -359,7 +361,7 @@ protected List<ManifestFileMeta> tryReadManifestList(String manifestListName) {
359361 try {
360362 return manifestList .read (manifestListName );
361363 } catch (Exception e ) {
362- LOG .warn ("Failed to read manifest list file " + manifestListName , e );
364+ LOG .warn ("Failed to read manifest list file {}" , manifestListName , e );
363365 return Collections .emptyList ();
364366 }
365367 }
@@ -371,7 +373,8 @@ protected List<ManifestFileMeta> tryReadManifestList(String manifestListName) {
371373 protected void addMergedDataFiles (
372374 Map <BinaryRow , Map <Integer , Set <String >>> dataFiles , Snapshot snapshot )
373375 throws IOException {
374- for (ExpireFileEntry entry : readMergedDataFiles (manifestList .readAllManifests (snapshot ))) {
376+ for (ExpireFileEntry entry :
377+ readMergedDataFiles (manifestList .readDataManifests (snapshot ))) {
375378 dataFiles
376379 .computeIfAbsent (entry .partition (), p -> new HashMap <>())
377380 .computeIfAbsent (entry .bucket (), b -> new HashSet <>())
0 commit comments