Skip to content

Commit

Permalink
InputFile.length is being called since apache/iceberg#9592
Browse files Browse the repository at this point in the history
  • Loading branch information
nastra committed Feb 20, 2024
1 parent 2dd595f commit 0c7b54c
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public void testCreateOrReplaceTableAsSelect()
.add(new FileOperation(SNAPSHOT, "OutputFile.createOrOverwrite"))
.add(new FileOperation(MANIFEST, "OutputFile.createOrOverwrite"))
.add(new FileOperation(MANIFEST, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.length"))
.add(new FileOperation(STATS, "OutputFile.create"))
.build());
}
Expand All @@ -197,6 +198,7 @@ public void testSelect()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.length"))
.build());
}

Expand All @@ -223,6 +225,7 @@ public void testSelectWithLimit(int numberOfFiles)
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), min(icebergManifestPrefetching, numberOfFiles))
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), min(icebergManifestPrefetching, numberOfFiles))
.build());

assertFileSystemAccesses("EXPLAIN SELECT * FROM test_select_with_limit LIMIT 3",
Expand All @@ -231,6 +234,7 @@ public void testSelectWithLimit(int numberOfFiles)
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), numberOfFiles)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), numberOfFiles)
.build());

assertFileSystemAccesses("EXPLAIN ANALYZE SELECT * FROM test_select_with_limit LIMIT 3",
Expand All @@ -239,6 +243,7 @@ public void testSelectWithLimit(int numberOfFiles)
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), numberOfFiles + min(icebergManifestPrefetching, numberOfFiles))
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), numberOfFiles + min(icebergManifestPrefetching, numberOfFiles))
.build());

assertUpdate("DROP TABLE test_select_with_limit");
Expand Down Expand Up @@ -271,6 +276,7 @@ public void testReadWholePartition()
ALL_FILES,
ImmutableMultiset.<FileOperation>builder()
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 2)
.add(new FileOperation(METADATA_JSON, "InputFile.newStream"))
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
Expand All @@ -283,6 +289,7 @@ public void testReadWholePartition()
ALL_FILES,
ImmutableMultiset.<FileOperation>builder()
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 2)
.add(new FileOperation(METADATA_JSON, "InputFile.newStream"))
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
Expand All @@ -294,6 +301,7 @@ public void testReadWholePartition()
ALL_FILES,
ImmutableMultiset.<FileOperation>builder()
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 2)
.add(new FileOperation(METADATA_JSON, "InputFile.newStream"))
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
Expand All @@ -305,6 +313,7 @@ public void testReadWholePartition()
ALL_FILES,
ImmutableMultiset.<FileOperation>builder()
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 2)
.add(new FileOperation(METADATA_JSON, "InputFile.newStream"))
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
Expand All @@ -319,6 +328,7 @@ public void testReadWholePartition()
ALL_FILES,
ImmutableMultiset.<FileOperation>builder()
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 2)
.add(new FileOperation(METADATA_JSON, "InputFile.newStream"))
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
Expand Down Expand Up @@ -355,6 +365,7 @@ public void testReadWholePartitionSplittableFile()
ALL_FILES,
ImmutableMultiset.<FileOperation>builder()
.add(new FileOperation(MANIFEST, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.length"))
.add(new FileOperation(METADATA_JSON, "InputFile.newStream"))
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
Expand All @@ -367,6 +378,7 @@ public void testReadWholePartitionSplittableFile()
ALL_FILES,
ImmutableMultiset.<FileOperation>builder()
.add(new FileOperation(MANIFEST, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.length"))
.add(new FileOperation(METADATA_JSON, "InputFile.newStream"))
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
Expand Down Expand Up @@ -397,20 +409,23 @@ public void testSelectFromVersionedTable()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.length"))
.build());
assertFileSystemAccesses("SELECT * FROM " + tableName + " FOR VERSION AS OF " + v3SnapshotId,
ImmutableMultiset.<FileOperation>builder()
.add(new FileOperation(METADATA_JSON, "InputFile.newStream"))
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 2)
.build());
assertFileSystemAccesses("SELECT * FROM " + tableName,
ImmutableMultiset.<FileOperation>builder()
.add(new FileOperation(METADATA_JSON, "InputFile.newStream"))
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 2)
.build());
}

Expand All @@ -437,20 +452,23 @@ public void testSelectFromVersionedTableWithSchemaEvolution()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.length"))
.build());
assertFileSystemAccesses("SELECT * FROM " + tableName + " FOR VERSION AS OF " + v3SnapshotId,
ImmutableMultiset.<FileOperation>builder()
.add(new FileOperation(METADATA_JSON, "InputFile.newStream"))
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 2)
.build());
assertFileSystemAccesses("SELECT * FROM " + tableName,
ImmutableMultiset.<FileOperation>builder()
.add(new FileOperation(METADATA_JSON, "InputFile.newStream"))
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 2)
.build());
}

Expand All @@ -464,6 +482,7 @@ public void testSelectWithFilter()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.length"))
.build());
}

Expand All @@ -479,6 +498,7 @@ public void testJoin()
.addCopies(new FileOperation(SNAPSHOT, "InputFile.length"), 2)
.addCopies(new FileOperation(SNAPSHOT, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 4)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 4)
.build());
}

Expand All @@ -496,6 +516,7 @@ public void testJoinWithPartitionedTable()
.addCopies(new FileOperation(SNAPSHOT, "InputFile.length"), 2)
.addCopies(new FileOperation(SNAPSHOT, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 4)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 4)
.build());
}

Expand All @@ -510,6 +531,7 @@ public void testExplainSelect()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.length"))
.build());
}

Expand All @@ -524,6 +546,7 @@ public void testShowStatsForTable()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.length"))
.build());
}

Expand All @@ -540,6 +563,7 @@ public void testShowStatsForPartitionedTable()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.length"))
.build());
}

Expand All @@ -554,6 +578,7 @@ public void testShowStatsForTableWithFilter()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.length"))
.build());
}

Expand All @@ -570,6 +595,7 @@ public void testPredicateWithVarcharCastToDate()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 2)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 2)
.build());

// CAST to date and comparison
Expand All @@ -579,6 +605,7 @@ public void testPredicateWithVarcharCastToDate()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.newStream")) // fewer than without filter
.add(new FileOperation(MANIFEST, "InputFile.length"))
.build());

// CAST to date and BETWEEN
Expand All @@ -588,6 +615,7 @@ public void testPredicateWithVarcharCastToDate()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.newStream")) // fewer than without filter
.add(new FileOperation(MANIFEST, "InputFile.length"))
.build());

// conversion to date as a date function
Expand All @@ -597,6 +625,7 @@ public void testPredicateWithVarcharCastToDate()
.add(new FileOperation(SNAPSHOT, "InputFile.length"))
.add(new FileOperation(SNAPSHOT, "InputFile.newStream"))
.add(new FileOperation(MANIFEST, "InputFile.newStream")) // fewer than without filter
.add(new FileOperation(MANIFEST, "InputFile.length"))
.build());

assertUpdate("DROP TABLE test_varchar_as_date_predicate");
Expand All @@ -622,6 +651,7 @@ public void testRemoveOrphanFiles()
.addCopies(new FileOperation(SNAPSHOT, "InputFile.length"), 4)
.addCopies(new FileOperation(SNAPSHOT, "InputFile.newStream"), 4)
.addCopies(new FileOperation(MANIFEST, "InputFile.newStream"), 5)
.addCopies(new FileOperation(MANIFEST, "InputFile.length"), 5)
.build());

assertUpdate("DROP TABLE " + tableName);
Expand Down

0 comments on commit 0c7b54c

Please sign in to comment.