This is an automated email from the ASF dual-hosted git repository.
JingsongLi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 8fff1ff5d4 [core] Rename to ProjectedManifestEntry
8fff1ff5d4 is described below
commit 8fff1ff5d45023b0454fbc67ba7b810c8c97f748
Author: JingsongLi <[email protected]>
AuthorDate: Tue Aug 11 16:33:08 2026 +0800
[core] Rename to ProjectedManifestEntry
---
.../DataEvolutionRowIdAssignmentPlanner.java | 27 +++++++-------
.../DataEvolutionRowIdReassigner.java | 14 ++++----
.../DataEvolutionGlobalIndexRefreshPlanner.java | 30 ++++++++--------
...ataFileMeta.java => ProjectedDataFileMeta.java} | 10 +++---
.../paimon/manifest/CompactFileIdentifierSet.java | 4 +--
.../java/org/apache/paimon/manifest/FileEntry.java | 28 +++++++--------
.../org/apache/paimon/manifest/ManifestFile.java | 16 ++++-----
...ifestEntry.java => ProjectedManifestEntry.java} | 41 +++++++++++-----------
.../operation/ManifestEntryExternalSort.java | 23 ++++++------
.../paimon/operation/ManifestFileSorter.java | 17 ++++-----
...etaTest.java => ProjectedDataFileMetaTest.java} | 18 +++++-----
.../manifest/FileEntryReusableIdentifierTest.java | 20 +++++------
.../apache/paimon/manifest/ManifestFileTest.java | 36 +++++++++----------
...ryTest.java => ProjectedManifestEntryTest.java} | 32 ++++++++---------
14 files changed, 160 insertions(+), 156 deletions(-)
diff --git
a/paimon-core/src/main/java/org/apache/paimon/append/dataevolution/DataEvolutionRowIdAssignmentPlanner.java
b/paimon-core/src/main/java/org/apache/paimon/append/dataevolution/DataEvolutionRowIdAssignmentPlanner.java
index c3cec83638..939daa6ff6 100644
---
a/paimon-core/src/main/java/org/apache/paimon/append/dataevolution/DataEvolutionRowIdAssignmentPlanner.java
+++
b/paimon-core/src/main/java/org/apache/paimon/append/dataevolution/DataEvolutionRowIdAssignmentPlanner.java
@@ -22,15 +22,15 @@ import org.apache.paimon.codegen.CodeGenUtils;
import org.apache.paimon.codegen.RecordComparator;
import org.apache.paimon.data.BinaryRow;
import org.apache.paimon.data.BinaryString;
-import org.apache.paimon.io.BinaryDataFileMeta;
import org.apache.paimon.io.DataFileMeta;
-import org.apache.paimon.manifest.BinaryManifestEntry;
-import org.apache.paimon.manifest.BinaryManifestEntry.Projection;
+import org.apache.paimon.io.ProjectedDataFileMeta;
import org.apache.paimon.manifest.CompactFileIdentifierSet;
import org.apache.paimon.manifest.FileEntry.ReusableIdentifier;
import org.apache.paimon.manifest.ManifestEntry;
import org.apache.paimon.manifest.ManifestFile;
import org.apache.paimon.manifest.ManifestFileMeta;
+import org.apache.paimon.manifest.ProjectedManifestEntry;
+import org.apache.paimon.manifest.ProjectedManifestEntry.Projection;
import org.apache.paimon.partition.PartitionPredicate;
import org.apache.paimon.table.FileStoreTable;
import org.apache.paimon.table.SpecialFields;
@@ -190,11 +190,12 @@ final class DataEvolutionRowIdAssignmentPlanner {
if (manifestMeta.numDeletedFiles() <= 0) {
continue;
}
- try (CloseableIterator<BinaryManifestEntry> entries =
+ try (CloseableIterator<ProjectedManifestEntry> entries =
manifestFile.scan(
- manifestMeta.fileName(),
BinaryManifestEntry.DELETE_ENTRY_PROJECTION)) {
+ manifestMeta.fileName(),
+ ProjectedManifestEntry.DELETE_ENTRY_PROJECTION)) {
while (entries.hasNext()) {
- BinaryManifestEntry entry = entries.next();
+ ProjectedManifestEntry entry = entries.next();
if (!entry.isDelete()) {
continue;
}
@@ -225,10 +226,10 @@ final class DataEvolutionRowIdAssignmentPlanner {
continue;
}
int manifestOrdinal = ordinal(manifestMeta);
- try (CloseableIterator<BinaryManifestEntry> entries =
+ try (CloseableIterator<ProjectedManifestEntry> entries =
manifestFile.scan(manifestMeta.fileName(), addProjection))
{
while (entries.hasNext()) {
- BinaryManifestEntry entry = entries.next();
+ ProjectedManifestEntry entry = entries.next();
if (!entry.isAdd()) {
continue;
}
@@ -243,7 +244,7 @@ final class DataEvolutionRowIdAssignmentPlanner {
}
}
- BinaryDataFileMeta file = entry.file();
+ ProjectedDataFileMeta file = entry.file();
BinaryString fileName = file.fileNameBinary();
readRowRange(file, manifestOrdinal, fileName,
rowRangeScratch);
checkState(
@@ -275,10 +276,10 @@ final class DataEvolutionRowIdAssignmentPlanner {
if (!manifestMayContainSelectedRange(manifestMeta)) {
continue;
}
- try (CloseableIterator<BinaryManifestEntry> entries =
+ try (CloseableIterator<ProjectedManifestEntry> entries =
manifestFile.scan(manifestMeta.fileName(),
REWRITE_PROJECTION)) {
while (entries.hasNext()) {
- BinaryManifestEntry entry = entries.next();
+ ProjectedManifestEntry entry = entries.next();
lookup.reset(entry.partitionBytes());
SelectedPartition selection;
try {
@@ -289,7 +290,7 @@ final class DataEvolutionRowIdAssignmentPlanner {
if (selection == null) {
continue;
}
- BinaryDataFileMeta file = entry.file();
+ ProjectedDataFileMeta file = entry.file();
readRowRange(file, manifestOrdinal, null, rowRangeScratch);
if (!selection.logicalRanges.covers(rowRangeScratch[0],
rowRangeScratch[1])) {
continue;
@@ -432,7 +433,7 @@ final class DataEvolutionRowIdAssignmentPlanner {
}
private static void readRowRange(
- BinaryDataFileMeta file,
+ ProjectedDataFileMeta file,
int manifestOrdinal,
@Nullable BinaryString fileName,
long[] result) {
diff --git
a/paimon-core/src/main/java/org/apache/paimon/append/dataevolution/DataEvolutionRowIdReassigner.java
b/paimon-core/src/main/java/org/apache/paimon/append/dataevolution/DataEvolutionRowIdReassigner.java
index 35029ab593..361b9a812a 100644
---
a/paimon-core/src/main/java/org/apache/paimon/append/dataevolution/DataEvolutionRowIdReassigner.java
+++
b/paimon-core/src/main/java/org/apache/paimon/append/dataevolution/DataEvolutionRowIdReassigner.java
@@ -26,7 +26,6 @@ import org.apache.paimon.codegen.RecordComparator;
import org.apache.paimon.data.BinaryRow;
import org.apache.paimon.index.GlobalIndexMeta;
import org.apache.paimon.index.IndexFileMeta;
-import org.apache.paimon.manifest.BinaryManifestEntry;
import org.apache.paimon.manifest.FileKind;
import org.apache.paimon.manifest.IndexManifestEntry;
import org.apache.paimon.manifest.IndexManifestFile;
@@ -34,6 +33,7 @@ import org.apache.paimon.manifest.ManifestEntry;
import org.apache.paimon.manifest.ManifestFile;
import org.apache.paimon.manifest.ManifestFileMeta;
import org.apache.paimon.manifest.ManifestList;
+import org.apache.paimon.manifest.ProjectedManifestEntry;
import org.apache.paimon.operation.FileStoreCommitImpl;
import org.apache.paimon.options.Options;
import org.apache.paimon.partition.PartitionPredicate;
@@ -478,11 +478,11 @@ public class DataEvolutionRowIdReassigner {
AssignmentPlan assignmentPlan,
ManifestFile manifestFile,
ManifestFileMeta manifestMeta) {
- try (CloseableIterator<BinaryManifestEntry> entries =
+ try (CloseableIterator<ProjectedManifestEntry> entries =
manifestFile.scan(
- manifestMeta.fileName(),
BinaryManifestEntry.ROW_RANGE_PROJECTION)) {
+ manifestMeta.fileName(),
ProjectedManifestEntry.ROW_RANGE_PROJECTION)) {
while (entries.hasNext()) {
- BinaryManifestEntry entry = entries.next();
+ ProjectedManifestEntry entry = entries.next();
RowRangeMappingIndex mapping =
assignmentPlan.relativeRowIdMappings.mappings.get(entry.partition());
if (mapping != null &&
mapping.map(entry.file().nonNullRowIdRange()).isPresent()) {
@@ -504,11 +504,11 @@ public class DataEvolutionRowIdReassigner {
ManifestFileMeta manifestMeta,
long appendSnapshotId) {
boolean needsReassign = false;
- try (CloseableIterator<BinaryManifestEntry> entries =
+ try (CloseableIterator<ProjectedManifestEntry> entries =
manifestFile.scan(
- manifestMeta.fileName(),
BinaryManifestEntry.ROW_RANGE_PROJECTION)) {
+ manifestMeta.fileName(),
ProjectedManifestEntry.ROW_RANGE_PROJECTION)) {
while (entries.hasNext()) {
- BinaryManifestEntry entry = entries.next();
+ ProjectedManifestEntry entry = entries.next();
if (partitionPredicate != null &&
!partitionPredicate.test(entry.partition())) {
continue;
}
diff --git
a/paimon-core/src/main/java/org/apache/paimon/globalindex/DataEvolutionGlobalIndexRefreshPlanner.java
b/paimon-core/src/main/java/org/apache/paimon/globalindex/DataEvolutionGlobalIndexRefreshPlanner.java
index 60e2f57bb4..924749f4c8 100644
---
a/paimon-core/src/main/java/org/apache/paimon/globalindex/DataEvolutionGlobalIndexRefreshPlanner.java
+++
b/paimon-core/src/main/java/org/apache/paimon/globalindex/DataEvolutionGlobalIndexRefreshPlanner.java
@@ -22,15 +22,15 @@ import org.apache.paimon.Snapshot;
import org.apache.paimon.data.BinaryRow;
import org.apache.paimon.index.DataEvolutionIndexSourceMeta;
import org.apache.paimon.index.GlobalIndexMeta;
-import org.apache.paimon.io.BinaryDataFileMeta;
import org.apache.paimon.io.DataFileMeta;
-import org.apache.paimon.manifest.BinaryManifestEntry;
+import org.apache.paimon.io.ProjectedDataFileMeta;
import org.apache.paimon.manifest.CompactFileIdentifierSet;
import org.apache.paimon.manifest.FileKind;
import org.apache.paimon.manifest.IndexManifestEntry;
import org.apache.paimon.manifest.ManifestEntry;
import org.apache.paimon.manifest.ManifestFile;
import org.apache.paimon.manifest.ManifestFileMeta;
+import org.apache.paimon.manifest.ProjectedManifestEntry;
import org.apache.paimon.partition.PartitionPredicate;
import org.apache.paimon.schema.SchemaManager;
import org.apache.paimon.table.FileStoreTable;
@@ -97,10 +97,10 @@ public final class DataEvolutionGlobalIndexRefreshPlanner {
}
/**
- * Scans data manifests through reusable {@link BinaryManifestEntry} views
and plans indexes to
- * refresh. Neither {@link ManifestEntry} nor {@link DataFileMeta} POJOs
are materialized: one
- * narrow DELETE pass tracks removed files in a primitive identifier set,
then one projected ADD
- * pass merges updated row ranges directly into the refresh groups.
+ * Scans data manifests through reusable {@link ProjectedManifestEntry}
views and plans indexes
+ * to refresh. Neither {@link ManifestEntry} nor {@link DataFileMeta}
POJOs are materialized:
+ * one narrow DELETE pass tracks removed files in a primitive identifier
set, then one projected
+ * ADD pass merges updated row ranges directly into the refresh groups.
*/
public static List<IndexManifestEntry> findIndexesToRefresh(
FileStoreTable table,
@@ -183,11 +183,11 @@ public final class DataEvolutionGlobalIndexRefreshPlanner
{
if (manifest.numDeletedFiles() <= 0) {
continue;
}
- try (CloseableIterator<BinaryManifestEntry> entries =
+ try (CloseableIterator<ProjectedManifestEntry> entries =
manifestFile.scan(
- manifest.fileName(),
BinaryManifestEntry.DELETE_ENTRY_PROJECTION)) {
+ manifest.fileName(),
ProjectedManifestEntry.DELETE_ENTRY_PROJECTION)) {
while (entries.hasNext()) {
- BinaryManifestEntry entry = entries.next();
+ ProjectedManifestEntry entry = entries.next();
if (entry.isDelete() &&
groupPartitions.contains(entry.partition())) {
deleted.add(entry);
}
@@ -206,19 +206,19 @@ public final class DataEvolutionGlobalIndexRefreshPlanner
{
Map<Pair<BinaryRow, Integer>, RefreshGroup> groups,
Set<Integer> indexedFieldIds) {
Map<Pair<Long, List<String>>, Set<Integer>> fileFieldIdsCache = new
HashMap<>();
- BinaryManifestEntry.Projection projection =
addedEntryProjection(!deleted.isEmpty());
+ ProjectedManifestEntry.Projection projection =
addedEntryProjection(!deleted.isEmpty());
for (ManifestFileMeta manifest : manifests) {
if (manifest.numAddedFiles() <= 0) {
continue;
}
- try (CloseableIterator<BinaryManifestEntry> entries =
+ try (CloseableIterator<ProjectedManifestEntry> entries =
manifestFile.scan(manifest.fileName(), projection)) {
while (entries.hasNext()) {
- BinaryManifestEntry entry = entries.next();
+ ProjectedManifestEntry entry = entries.next();
if (!entry.isAdd()) {
continue;
}
- BinaryDataFileMeta file = entry.file();
+ ProjectedDataFileMeta file = entry.file();
if (!file.hasFirstRowId()) {
continue;
}
@@ -257,7 +257,7 @@ public final class DataEvolutionGlobalIndexRefreshPlanner {
* Projects only the fields the refresh planner consumes; identifier
fields are included only
* when deleted files must be recognized.
*/
- private static BinaryManifestEntry.Projection addedEntryProjection(
+ private static ProjectedManifestEntry.Projection addedEntryProjection(
boolean includeIdentifierFields) {
List<DataField> fileFields = new ArrayList<>();
fileFields.add(DataFileMeta.SCHEMA.getField(DataFileMeta.ROW_COUNT));
@@ -281,7 +281,7 @@ public final class DataEvolutionGlobalIndexRefreshPlanner {
ManifestEntry.MANIFEST_ROW_TYPE
.getField(ManifestEntry.FILE)
.newType(new RowType(false, fileFields)));
- return BinaryManifestEntry.Projection.create(new RowType(false,
fields));
+ return ProjectedManifestEntry.Projection.create(new RowType(false,
fields));
}
private static Set<Integer> indexedFieldIds(List<DataField> indexedFields)
{
diff --git
a/paimon-core/src/main/java/org/apache/paimon/io/BinaryDataFileMeta.java
b/paimon-core/src/main/java/org/apache/paimon/io/ProjectedDataFileMeta.java
similarity index 98%
rename from
paimon-core/src/main/java/org/apache/paimon/io/BinaryDataFileMeta.java
rename to
paimon-core/src/main/java/org/apache/paimon/io/ProjectedDataFileMeta.java
index be56deb207..b707065eb1 100644
--- a/paimon-core/src/main/java/org/apache/paimon/io/BinaryDataFileMeta.java
+++ b/paimon-core/src/main/java/org/apache/paimon/io/ProjectedDataFileMeta.java
@@ -48,17 +48,17 @@ import static
org.apache.paimon.utils.SerializationUtils.deserializeBinaryRow;
* fail explicitly when their fields were not projected. Operations which
create a modified data
* file are not supported.
*/
-public final class BinaryDataFileMeta implements DataFileMeta {
+public final class ProjectedDataFileMeta implements DataFileMeta {
private final Projection projection;
private @Nullable InternalRow row;
- private BinaryDataFileMeta(Projection projection) {
+ private ProjectedDataFileMeta(Projection projection) {
this.projection = projection;
}
/** Replaces the backing row and returns this reusable view. */
- public BinaryDataFileMeta replace(InternalRow row) {
+ public ProjectedDataFileMeta replace(InternalRow row) {
checkArgument(row != null, "Data file row cannot be null.");
if (row.getFieldCount() != projection.fieldCount) {
throw new IllegalArgumentException(
@@ -413,8 +413,8 @@ public final class BinaryDataFileMeta implements
DataFileMeta {
return new Projection(projectedType.getFieldCount(),
fieldPositions);
}
- public BinaryDataFileMeta createDataFile() {
- return new BinaryDataFileMeta(this);
+ public ProjectedDataFileMeta createDataFile() {
+ return new ProjectedDataFileMeta(this);
}
}
}
diff --git
a/paimon-core/src/main/java/org/apache/paimon/manifest/CompactFileIdentifierSet.java
b/paimon-core/src/main/java/org/apache/paimon/manifest/CompactFileIdentifierSet.java
index 5106edab1a..b11b213458 100644
---
a/paimon-core/src/main/java/org/apache/paimon/manifest/CompactFileIdentifierSet.java
+++
b/paimon-core/src/main/java/org/apache/paimon/manifest/CompactFileIdentifierSet.java
@@ -61,7 +61,7 @@ public final class CompactFileIdentifierSet {
return arenaSize;
}
- public void add(BinaryManifestEntry entry) {
+ public void add(ProjectedManifestEntry entry) {
add(reusableIdentifier().replaceWithPartition(entry));
}
@@ -74,7 +74,7 @@ public final class CompactFileIdentifierSet {
add(partitionId, identifier.bytes(), identifier.length());
}
- public boolean contains(BinaryManifestEntry entry) {
+ public boolean contains(ProjectedManifestEntry entry) {
return contains(reusableIdentifier().replaceWithPartition(entry));
}
diff --git
a/paimon-core/src/main/java/org/apache/paimon/manifest/FileEntry.java
b/paimon-core/src/main/java/org/apache/paimon/manifest/FileEntry.java
index f3f93f8778..11f08cf632 100644
--- a/paimon-core/src/main/java/org/apache/paimon/manifest/FileEntry.java
+++ b/paimon-core/src/main/java/org/apache/paimon/manifest/FileEntry.java
@@ -21,7 +21,7 @@ package org.apache.paimon.manifest;
import org.apache.paimon.data.BinaryRow;
import org.apache.paimon.data.BinaryString;
import org.apache.paimon.data.InternalRow;
-import org.apache.paimon.io.BinaryDataFileMeta;
+import org.apache.paimon.io.ProjectedDataFileMeta;
import org.apache.paimon.memory.MemorySegmentUtils;
import org.apache.paimon.utils.CloseableIterator;
import org.apache.paimon.utils.FileStorePathFactory;
@@ -186,36 +186,36 @@ public interface FileEntry {
* Reusable byte encoding of a binary manifest entry's {@link Identifier}
fields.
*
* <p>The encoded identifier is the prefix of {@link #bytes()} ending at
{@link #length()}. It
- * is valid until the next call to {@link #replace(BinaryManifestEntry)},
{@link
- * #replaceWithPartition(BinaryManifestEntry)}, or {@link #release()} and
must not be modified
- * by callers.
+ * is valid until the next call to {@link
#replace(ProjectedManifestEntry)}, {@link
+ * #replaceWithPartition(ProjectedManifestEntry)}, or {@link #release()}
and must not be
+ * modified by callers.
*
- * <p>{@link #replace(BinaryManifestEntry)} omits the partition so callers
can represent it with
- * a compact dictionary id. {@link
#replaceWithPartition(BinaryManifestEntry)} includes the
- * serialized partition and represents the complete base {@link
Identifier}.
+ * <p>{@link #replace(ProjectedManifestEntry)} omits the partition so
callers can represent it
+ * with a compact dictionary id. {@link
#replaceWithPartition(ProjectedManifestEntry)} includes
+ * the serialized partition and represents the complete base {@link
Identifier}.
*/
final class ReusableIdentifier {
private byte[] bytes = new byte[256];
private int length;
- public ReusableIdentifier replace(BinaryManifestEntry entry) {
+ public ReusableIdentifier replace(ProjectedManifestEntry entry) {
checkArgument(entry != null, "Binary manifest entry cannot be
null.");
length = 0;
return appendEntryFields(entry);
}
/** Replaces this encoding with the entry's partition and identity
fields. */
- public ReusableIdentifier replaceWithPartition(BinaryManifestEntry
entry) {
+ public ReusableIdentifier replaceWithPartition(ProjectedManifestEntry
entry) {
checkArgument(entry != null, "Binary manifest entry cannot be
null.");
length = 0;
putBytes(entry.partitionBytes());
return appendEntryFields(entry);
}
- private ReusableIdentifier appendEntryFields(BinaryManifestEntry
entry) {
+ private ReusableIdentifier appendEntryFields(ProjectedManifestEntry
entry) {
putInt(entry.bucket());
- BinaryDataFileMeta file = entry.file();
+ ProjectedDataFileMeta file = entry.file();
putInt(file.level());
putString(file.fileNameBinary());
@@ -356,12 +356,12 @@ public interface FileEntry {
manifest -> {
List<Identifier> identifiers =
new ArrayList<>((int)
Math.min(manifest.numDeletedFiles(), 1 << 20));
- try (CloseableIterator<BinaryManifestEntry> entries =
+ try (CloseableIterator<ProjectedManifestEntry> entries =
manifestFile.scan(
manifest.fileName(),
-
BinaryManifestEntry.DELETE_ENTRY_PROJECTION)) {
+
ProjectedManifestEntry.DELETE_ENTRY_PROJECTION)) {
while (entries.hasNext()) {
- BinaryManifestEntry entry = entries.next();
+ ProjectedManifestEntry entry = entries.next();
if (entry.isDelete()) {
identifiers.add(entry.identifier());
}
diff --git
a/paimon-core/src/main/java/org/apache/paimon/manifest/ManifestFile.java
b/paimon-core/src/main/java/org/apache/paimon/manifest/ManifestFile.java
index 3480d0c308..2400f8cc82 100644
--- a/paimon-core/src/main/java/org/apache/paimon/manifest/ManifestFile.java
+++ b/paimon-core/src/main/java/org/apache/paimon/manifest/ManifestFile.java
@@ -29,7 +29,7 @@ import org.apache.paimon.io.DataFileMeta;
import org.apache.paimon.io.RollingFileWriter;
import org.apache.paimon.io.RollingFileWriterImpl;
import org.apache.paimon.io.SingleFileWriter;
-import org.apache.paimon.manifest.BinaryManifestEntry.Projection;
+import org.apache.paimon.manifest.ProjectedManifestEntry.Projection;
import org.apache.paimon.operation.metrics.CacheMetrics;
import org.apache.paimon.partition.PartitionPredicate;
import org.apache.paimon.schema.SchemaManager;
@@ -155,13 +155,13 @@ public class ManifestFile extends
ObjectsFile<ManifestEntry> {
/**
* Scans projected manifest entries without materializing {@link
PojoManifestEntry}s.
*
- * <p>Every returned {@link BinaryManifestEntry} has independent backing
data and can be
+ * <p>Every returned {@link ProjectedManifestEntry} has independent
backing data and can be
* retained after the iterator advances or closes. The caller must close
the iterator.
*
* <p>This method intentionally bypasses the manifest cache because cached
entries are
* materialized with the complete manifest schema.
*/
- public CloseableIterator<BinaryManifestEntry> scan(String fileName,
Projection projection) {
+ public CloseableIterator<ProjectedManifestEntry> scan(String fileName,
Projection projection) {
try {
CloseableIterator<InternalRow> rows =
createManifestIterator(
@@ -170,7 +170,7 @@ public class ManifestFile extends
ObjectsFile<ManifestEntry> {
projection.projectedType(),
null,
null);
- return new CloseableIterator<BinaryManifestEntry>() {
+ return new CloseableIterator<ProjectedManifestEntry>() {
@Override
public boolean hasNext() {
@@ -178,7 +178,7 @@ public class ManifestFile extends
ObjectsFile<ManifestEntry> {
}
@Override
- public BinaryManifestEntry next() {
+ public ProjectedManifestEntry next() {
return projection.createEntry().replace(rows.next());
}
@@ -215,7 +215,7 @@ public class ManifestFile extends
ObjectsFile<ManifestEntry> {
public List<ExpireFileEntry> readExpireFileEntries(String fileName) {
List<ExpireFileEntry> result = new ArrayList<>();
- try (CloseableIterator<BinaryManifestEntry> entries =
+ try (CloseableIterator<ProjectedManifestEntry> entries =
scan(fileName, EXPIRE_FILE_PROJECTION)) {
while (entries.hasNext()) {
result.add(ExpireFileEntry.from(entries.next()));
@@ -311,8 +311,8 @@ public class ManifestFile extends
ObjectsFile<ManifestEntry> {
@Override
public void write(ManifestEntry entry) throws IOException {
- if (entry instanceof BinaryManifestEntry) {
- writeRow(((BinaryManifestEntry) entry).fullRow());
+ if (entry instanceof ProjectedManifestEntry) {
+ writeRow(((ProjectedManifestEntry) entry).fullRow());
} else {
super.write(entry);
}
diff --git
a/paimon-core/src/main/java/org/apache/paimon/manifest/BinaryManifestEntry.java
b/paimon-core/src/main/java/org/apache/paimon/manifest/ProjectedManifestEntry.java
similarity index 90%
rename from
paimon-core/src/main/java/org/apache/paimon/manifest/BinaryManifestEntry.java
rename to
paimon-core/src/main/java/org/apache/paimon/manifest/ProjectedManifestEntry.java
index 14a0f05822..feff0e1420 100644
---
a/paimon-core/src/main/java/org/apache/paimon/manifest/BinaryManifestEntry.java
+++
b/paimon-core/src/main/java/org/apache/paimon/manifest/ProjectedManifestEntry.java
@@ -20,8 +20,8 @@ package org.apache.paimon.manifest;
import org.apache.paimon.data.BinaryRow;
import org.apache.paimon.data.InternalRow;
-import org.apache.paimon.io.BinaryDataFileMeta;
import org.apache.paimon.io.DataFileMeta;
+import org.apache.paimon.io.ProjectedDataFileMeta;
import org.apache.paimon.types.DataField;
import org.apache.paimon.types.RowType;
@@ -30,6 +30,7 @@ import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.List;
+import static org.apache.paimon.manifest.ManifestEntry.MANIFEST_ROW_TYPE;
import static org.apache.paimon.utils.Preconditions.checkArgument;
import static org.apache.paimon.utils.Preconditions.checkState;
import static org.apache.paimon.utils.SerializationUtils.deserializeBinaryRow;
@@ -43,18 +44,17 @@ import static
org.apache.paimon.utils.SerializationUtils.deserializeBinaryRow;
* InternalRow} remains valid. Producers such as {@link
ManifestFile#scan(String, Projection)}
* provide independently backed entries which can be retained.
*/
-public final class BinaryManifestEntry implements ManifestEntry {
+public final class ProjectedManifestEntry implements ManifestEntry {
- private static final Projection FULL_PROJECTION =
- Projection.create(ManifestEntry.MANIFEST_ROW_TYPE);
+ private static final Projection FULL_PROJECTION =
Projection.create(MANIFEST_ROW_TYPE);
public static final Projection DELETE_ENTRY_PROJECTION =
createDeleteEntryProjection();
public static final Projection ROW_RANGE_PROJECTION =
createRowRangeProjection();
private final Projection projection;
- private final @Nullable BinaryDataFileMeta file;
+ private final @Nullable ProjectedDataFileMeta file;
private @Nullable InternalRow row;
- private BinaryManifestEntry(Projection projection) {
+ private ProjectedManifestEntry(Projection projection) {
this.projection = projection;
this.file =
projection.fileProjection == null
@@ -63,7 +63,7 @@ public final class BinaryManifestEntry implements
ManifestEntry {
}
/** Replaces the backing row and returns this reusable view. */
- public BinaryManifestEntry replace(InternalRow row) {
+ public ProjectedManifestEntry replace(InternalRow row) {
checkArgument(row != null, "Manifest row cannot be null.");
if (row.getFieldCount() != projection.projectedType.getFieldCount()) {
throw new IllegalArgumentException(
@@ -96,7 +96,7 @@ public final class BinaryManifestEntry implements
ManifestEntry {
}
private static Projection createDeleteEntryProjection() {
- RowType manifestType = ManifestEntry.MANIFEST_ROW_TYPE;
+ RowType manifestType = MANIFEST_ROW_TYPE;
return Projection.create(
new RowType(
false,
@@ -116,7 +116,7 @@ public final class BinaryManifestEntry implements
ManifestEntry {
}
private static Projection createRowRangeProjection() {
- RowType manifestType = ManifestEntry.MANIFEST_ROW_TYPE;
+ RowType manifestType = MANIFEST_ROW_TYPE;
return Projection.create(
new RowType(
false,
@@ -215,7 +215,7 @@ public final class BinaryManifestEntry implements
ManifestEntry {
@Override
public Identifier identifier() {
- BinaryDataFileMeta file = file();
+ ProjectedDataFileMeta file = file();
return new Identifier(
partition(),
bucket(),
@@ -237,7 +237,7 @@ public final class BinaryManifestEntry implements
ManifestEntry {
}
@Override
- public BinaryDataFileMeta file() {
+ public ProjectedDataFileMeta file() {
checkState(row != null, "Binary manifest entry is not backed by a
row.");
if (file == null) {
throw unsupported(ManifestEntry.FILE);
@@ -299,7 +299,7 @@ public final class BinaryManifestEntry implements
ManifestEntry {
private final int totalBucketsPosition;
private final int filePosition;
private final int projectedFileFieldCount;
- private final @Nullable BinaryDataFileMeta.Projection fileProjection;
+ private final @Nullable ProjectedDataFileMeta.Projection
fileProjection;
private final boolean fullProjection;
private Projection(
@@ -310,7 +310,7 @@ public final class BinaryManifestEntry implements
ManifestEntry {
int totalBucketsPosition,
int filePosition,
int projectedFileFieldCount,
- @Nullable BinaryDataFileMeta.Projection fileProjection,
+ @Nullable ProjectedDataFileMeta.Projection fileProjection,
boolean fullProjection) {
this.projectedType = projectedType;
this.kindPosition = kindPosition;
@@ -329,12 +329,12 @@ public final class BinaryManifestEntry implements
ManifestEntry {
int filePosition = projectedType.getFieldIndex(ManifestEntry.FILE);
int projectedFileFieldCount = 0;
- BinaryDataFileMeta.Projection fileProjection = null;
+ ProjectedDataFileMeta.Projection fileProjection = null;
if (filePosition >= 0) {
RowType projectedFileType =
(RowType)
projectedType.getFields().get(filePosition).type();
projectedFileFieldCount = projectedFileType.getFieldCount();
- fileProjection =
BinaryDataFileMeta.Projection.create(projectedFileType);
+ fileProjection =
ProjectedDataFileMeta.Projection.create(projectedFileType);
}
return new Projection(
@@ -346,18 +346,17 @@ public final class BinaryManifestEntry implements
ManifestEntry {
filePosition,
projectedFileFieldCount,
fileProjection,
- projectedType.equals(ManifestEntry.MANIFEST_ROW_TYPE));
+ projectedType.equals(MANIFEST_ROW_TYPE));
}
private static void validateProjection(RowType projectedType) {
for (DataField projectedField : projectedType.getFields()) {
checkArgument(
-
ManifestEntry.MANIFEST_ROW_TYPE.containsField(projectedField.id()),
+ MANIFEST_ROW_TYPE.containsField(projectedField.id()),
"Unknown projected manifest field '%s' (id %s).",
projectedField.name(),
projectedField.id());
- DataField manifestField =
-
ManifestEntry.MANIFEST_ROW_TYPE.getField(projectedField.id());
+ DataField manifestField =
MANIFEST_ROW_TYPE.getField(projectedField.id());
checkArgument(
projectedField.isPrunedFrom(manifestField),
"Projected manifest field '%s' does not match %s.",
@@ -370,8 +369,8 @@ public final class BinaryManifestEntry implements
ManifestEntry {
return projectedType;
}
- public BinaryManifestEntry createEntry() {
- return new BinaryManifestEntry(this);
+ public ProjectedManifestEntry createEntry() {
+ return new ProjectedManifestEntry(this);
}
}
}
diff --git
a/paimon-core/src/main/java/org/apache/paimon/operation/ManifestEntryExternalSort.java
b/paimon-core/src/main/java/org/apache/paimon/operation/ManifestEntryExternalSort.java
index 2b05614800..58866adb82 100644
---
a/paimon-core/src/main/java/org/apache/paimon/operation/ManifestEntryExternalSort.java
+++
b/paimon-core/src/main/java/org/apache/paimon/operation/ManifestEntryExternalSort.java
@@ -25,12 +25,12 @@ import org.apache.paimon.data.GenericRow;
import org.apache.paimon.data.serializer.InternalRowSerializer;
import org.apache.paimon.disk.IOManager;
import org.apache.paimon.io.RollingFileWriter;
-import org.apache.paimon.manifest.BinaryManifestEntry;
import org.apache.paimon.manifest.CompactFileIdentifierSet;
import org.apache.paimon.manifest.FileEntry.ReusableIdentifier;
import org.apache.paimon.manifest.ManifestEntry;
import org.apache.paimon.manifest.ManifestFile;
import org.apache.paimon.manifest.ManifestFileMeta;
+import org.apache.paimon.manifest.ProjectedManifestEntry;
import org.apache.paimon.options.MemorySize;
import org.apache.paimon.sort.BinaryExternalSortBuffer;
import org.apache.paimon.utils.CloseableIterator;
@@ -113,8 +113,9 @@ public class ManifestEntryExternalSort {
if (section.size() <= 1
|| (manifestReadParallelism != null && manifestReadParallelism
<= 1)) {
for (ManifestFileMeta meta : section) {
- try (CloseableIterator<BinaryManifestEntry> entries =
- manifestFile.scan(meta.fileName(),
BinaryManifestEntry.fullProjection())) {
+ try (CloseableIterator<ProjectedManifestEntry> entries =
+ manifestFile.scan(
+ meta.fileName(),
ProjectedManifestEntry.fullProjection())) {
while (entries.hasNext()) {
consumer.accept(entries.next());
}
@@ -125,7 +126,7 @@ public class ManifestEntryExternalSort {
Function<ManifestFileMeta, List<BinaryRow>> reader =
meta -> readBinaryRows(manifestFile, meta);
- BinaryManifestEntry entry =
BinaryManifestEntry.fullProjection().createEntry();
+ ProjectedManifestEntry entry =
ProjectedManifestEntry.fullProjection().createEntry();
for (BinaryRow row : sequentialBatchedExecute(reader, section,
manifestReadParallelism)) {
consumer.accept(entry.replace(row));
}
@@ -138,8 +139,8 @@ public class ManifestEntryExternalSort {
List<BinaryRow> rows = new ArrayList<>((int) Math.min(entryCount, 1 <<
20));
InternalRowSerializer serializer =
new InternalRowSerializer(ManifestEntry.MANIFEST_ROW_TYPE);
- try (CloseableIterator<BinaryManifestEntry> entries =
- manifestFile.scan(meta.fileName(),
BinaryManifestEntry.fullProjection())) {
+ try (CloseableIterator<ProjectedManifestEntry> entries =
+ manifestFile.scan(meta.fileName(),
ProjectedManifestEntry.fullProjection())) {
while (entries.hasNext()) {
rows.add(serializer.toBinaryRow(entries.next().fullRow()).copy());
}
@@ -152,7 +153,7 @@ public class ManifestEntryExternalSort {
@FunctionalInterface
private interface BinaryEntryConsumer {
- void accept(BinaryManifestEntry entry) throws Exception;
+ void accept(ProjectedManifestEntry entry) throws Exception;
}
/** Config used by manifest entry external sort. */
@@ -218,7 +219,7 @@ public class ManifestEntryExternalSort {
config.maxDiskSize);
}
- private void write(BinaryManifestEntry entry) throws Exception {
+ private void write(ProjectedManifestEntry entry) throws Exception {
sortKey.replaceExternalSortRow(externalSortRow, entry,
entry.fullRow());
sortBuffer.write(externalSortRow);
}
@@ -238,7 +239,8 @@ public class ManifestEntryExternalSort {
try {
MutableObjectIterator<BinaryRow> iterator =
sortBuffer.sortedIterator();
BinaryRow reuse = new
BinaryRow(sortKey.externalSortRowType().getFieldCount());
- BinaryManifestEntry entry =
BinaryManifestEntry.fullProjection().createEntry();
+ ProjectedManifestEntry entry =
+ ProjectedManifestEntry.fullProjection().createEntry();
BinaryRow row;
while ((row = iterator.next(reuse)) != null) {
writer.write(entry.replace(sortKey.binaryManifestRow(row)));
@@ -276,7 +278,8 @@ public class ManifestEntryExternalSort {
try {
MutableObjectIterator<BinaryRow> iterator =
sortBuffer.sortedIterator();
BinaryRow reuse = new
BinaryRow(sortKey.externalSortRowType().getFieldCount());
- BinaryManifestEntry entry =
BinaryManifestEntry.fullProjection().createEntry();
+ ProjectedManifestEntry entry =
+ ProjectedManifestEntry.fullProjection().createEntry();
BinaryRow row;
while ((row = iterator.next(reuse)) != null) {
entry.replace(sortKey.binaryManifestRow(row));
diff --git
a/paimon-core/src/main/java/org/apache/paimon/operation/ManifestFileSorter.java
b/paimon-core/src/main/java/org/apache/paimon/operation/ManifestFileSorter.java
index ad7365a6b0..6ca30b6444 100644
---
a/paimon-core/src/main/java/org/apache/paimon/operation/ManifestFileSorter.java
+++
b/paimon-core/src/main/java/org/apache/paimon/operation/ManifestFileSorter.java
@@ -26,11 +26,11 @@ import org.apache.paimon.data.BinaryString;
import org.apache.paimon.data.GenericRow;
import org.apache.paimon.data.InternalRow;
import org.apache.paimon.disk.IOManager;
-import org.apache.paimon.manifest.BinaryManifestEntry;
import org.apache.paimon.manifest.CompactFileIdentifierSet;
import org.apache.paimon.manifest.ManifestEntry;
import org.apache.paimon.manifest.ManifestFile;
import org.apache.paimon.manifest.ManifestFileMeta;
+import org.apache.paimon.manifest.ProjectedManifestEntry;
import org.apache.paimon.partition.PartitionPredicate;
import org.apache.paimon.types.DataType;
import org.apache.paimon.types.DataTypes;
@@ -591,10 +591,11 @@ public class ManifestFileSorter {
CompactFileIdentifierSet identifiers,
Set<BinaryRow> partitions,
boolean synchronize) {
- try (CloseableIterator<BinaryManifestEntry> entries =
- manifestFile.scan(meta.fileName(),
BinaryManifestEntry.DELETE_ENTRY_PROJECTION)) {
+ try (CloseableIterator<ProjectedManifestEntry> entries =
+ manifestFile.scan(
+ meta.fileName(),
ProjectedManifestEntry.DELETE_ENTRY_PROJECTION)) {
while (entries.hasNext()) {
- BinaryManifestEntry entry = entries.next();
+ ProjectedManifestEntry entry = entries.next();
if (!entry.isDelete()) {
continue;
}
@@ -1258,8 +1259,8 @@ public class ManifestFileSorter {
row.setField(1, entry.kind().toByteValue());
row.setField(
2,
- entry instanceof BinaryManifestEntry
- ? ((BinaryManifestEntry)
entry).file().fileNameBinary()
+ entry instanceof ProjectedManifestEntry
+ ? ((ProjectedManifestEntry)
entry).file().fileNameBinary()
:
BinaryString.fromString(entry.file().fileName()));
row.setField(3, binaryManifestRow);
}
@@ -1359,8 +1360,8 @@ public class ManifestFileSorter {
row.setField(pos++, Long.MAX_VALUE -
entry.file().maxSequenceNumber());
row.setField(
pos++,
- entry instanceof BinaryManifestEntry
- ? ((BinaryManifestEntry)
entry).file().fileNameBinary()
+ entry instanceof ProjectedManifestEntry
+ ? ((ProjectedManifestEntry)
entry).file().fileNameBinary()
:
BinaryString.fromString(entry.file().fileName()));
row.setField(pos, binaryManifestRow);
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/io/BinaryDataFileMetaTest.java
b/paimon-core/src/test/java/org/apache/paimon/io/ProjectedDataFileMetaTest.java
similarity index 93%
rename from
paimon-core/src/test/java/org/apache/paimon/io/BinaryDataFileMetaTest.java
rename to
paimon-core/src/test/java/org/apache/paimon/io/ProjectedDataFileMetaTest.java
index df7c7a8f17..d684b44739 100644
--- a/paimon-core/src/test/java/org/apache/paimon/io/BinaryDataFileMetaTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/io/ProjectedDataFileMetaTest.java
@@ -35,8 +35,8 @@ import java.util.Collections;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-/** Tests for {@link BinaryDataFileMeta}. */
-public class BinaryDataFileMetaTest {
+/** Tests for {@link ProjectedDataFileMeta}. */
+public class ProjectedDataFileMetaTest {
@Test
void testImplementsProjectedDataFileMeta() {
@@ -56,8 +56,8 @@ public class BinaryDataFileMetaTest {
"external/dir/data.parquet",
10L,
Collections.singletonList("write_col"));
- BinaryDataFileMeta actual =
- BinaryDataFileMeta.Projection.create(DataFileMeta.SCHEMA)
+ ProjectedDataFileMeta actual =
+ ProjectedDataFileMeta.Projection.create(DataFileMeta.SCHEMA)
.createDataFile()
.replace(new DataFileMetaSerializer().toRow(expected));
@@ -116,8 +116,8 @@ public class BinaryDataFileMetaTest {
DataFileMeta.FILE_NAME,
DataFileMeta.ROW_COUNT,
DataFileMeta.WRITE_COLS);
- BinaryDataFileMeta file =
- BinaryDataFileMeta.Projection.create(projectedType)
+ ProjectedDataFileMeta file =
+ ProjectedDataFileMeta.Projection.create(projectedType)
.createDataFile()
.replace(
GenericRow.of(null,
BinaryString.fromString("data.orc"), 7L, null));
@@ -133,8 +133,8 @@ public class BinaryDataFileMetaTest {
@Test
void testReusesAndClearsView() {
RowType projectedType =
DataFileMeta.SCHEMA.project(DataFileMeta.FILE_NAME);
- BinaryDataFileMeta file =
-
BinaryDataFileMeta.Projection.create(projectedType).createDataFile();
+ ProjectedDataFileMeta file =
+
ProjectedDataFileMeta.Projection.create(projectedType).createDataFile();
file.replace(GenericRow.of(BinaryString.fromString("first.parquet")));
assertThat(file.fileName()).isEqualTo("first.parquet");
@@ -155,7 +155,7 @@ public class BinaryDataFileMetaTest {
.newType(SimpleStats.SCHEMA.project("_MIN_VALUES"));
RowType projectedType = new RowType(false,
Collections.singletonList(partialKeyStats));
- assertThatThrownBy(() ->
BinaryDataFileMeta.Projection.create(projectedType))
+ assertThatThrownBy(() ->
ProjectedDataFileMeta.Projection.create(projectedType))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining(DataFileMeta.KEY_STATS);
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/manifest/FileEntryReusableIdentifierTest.java
b/paimon-core/src/test/java/org/apache/paimon/manifest/FileEntryReusableIdentifierTest.java
index 82a4c70b8c..28c1cedae1 100644
---
a/paimon-core/src/test/java/org/apache/paimon/manifest/FileEntryReusableIdentifierTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/manifest/FileEntryReusableIdentifierTest.java
@@ -59,7 +59,7 @@ class FileEntryReusableIdentifierTest {
@Test
void testReusesAndReleasesBuffer() {
ReusableIdentifier identifier = new ReusableIdentifier();
- BinaryManifestEntry entry = entry(1, 0, "file", new String[0], null,
null);
+ ProjectedManifestEntry entry = entry(1, 0, "file", new String[0],
null, null);
identifier.replace(entry);
byte[] expected = Arrays.copyOf(identifier.bytes(),
identifier.length());
@@ -82,8 +82,8 @@ class FileEntryReusableIdentifierTest {
@Test
void testCompactFileIdentifierSetReusesIdentifierForEntryLookup() {
CompactFileIdentifierSet identifiers = new CompactFileIdentifierSet();
- BinaryManifestEntry first = entry(1, 0, "first", new String[0], null,
null);
- BinaryManifestEntry second = entry(2, 0, "second", new String[0],
null, null);
+ ProjectedManifestEntry first = entry(1, 0, "first", new String[0],
null, null);
+ ProjectedManifestEntry second = entry(2, 0, "second", new String[0],
null, null);
identifiers.add(first);
assertThat(identifiers.contains(first)).isTrue();
@@ -97,7 +97,7 @@ class FileEntryReusableIdentifierTest {
@Test
void testCompactAndMaterializedIdentifierSemanticsMatch() {
- BinaryManifestEntry base =
+ ProjectedManifestEntry base =
entry(
BinaryRow.EMPTY_ROW,
3,
@@ -107,7 +107,7 @@ class FileEntryReusableIdentifierTest {
new String[] {"a", "bc"},
new byte[] {7, 8},
"x");
- List<BinaryManifestEntry> candidates =
+ List<ProjectedManifestEntry> candidates =
Arrays.asList(
entry(
BinaryRow.EMPTY_ROW,
@@ -210,13 +210,13 @@ class FileEntryReusableIdentifierTest {
new byte[] {7, 8},
null));
- for (BinaryManifestEntry candidate : candidates) {
+ for (ProjectedManifestEntry candidate : candidates) {
assertIdentifierSemanticsMatch(base, candidate);
}
}
private static void assertIdentifierSemanticsMatch(
- BinaryManifestEntry left, BinaryManifestEntry right) {
+ ProjectedManifestEntry left, ProjectedManifestEntry right) {
boolean expected = left.identifier().equals(right.identifier());
CompactFileIdentifierSet completeIdentifiers = new
CompactFileIdentifierSet();
@@ -233,7 +233,7 @@ class FileEntryReusableIdentifierTest {
.isEqualTo(expected);
}
- private static BinaryManifestEntry entry(
+ private static ProjectedManifestEntry entry(
int bucket,
int level,
String fileName,
@@ -251,7 +251,7 @@ class FileEntryReusableIdentifierTest {
externalPath);
}
- private static BinaryManifestEntry entry(
+ private static ProjectedManifestEntry entry(
BinaryRow partition,
int bucket,
int totalBuckets,
@@ -278,7 +278,7 @@ class FileEntryReusableIdentifierTest {
for (int i = 0; i < extraFiles.length; i++) {
extraFileValues[i] = BinaryString.fromString(extraFiles[i]);
}
- return BinaryManifestEntry.Projection.create(new RowType(false,
fields))
+ return ProjectedManifestEntry.Projection.create(new RowType(false,
fields))
.createEntry()
.replace(
GenericRow.of(
diff --git
a/paimon-core/src/test/java/org/apache/paimon/manifest/ManifestFileTest.java
b/paimon-core/src/test/java/org/apache/paimon/manifest/ManifestFileTest.java
index f0f90126a6..c6376b7407 100644
--- a/paimon-core/src/test/java/org/apache/paimon/manifest/ManifestFileTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/manifest/ManifestFileTest.java
@@ -166,8 +166,8 @@ public class ManifestFileTest {
fields.get(5).newType(projectedFileType),
fields.get(2),
fields.get(1)));
- BinaryManifestEntry projectedEntry =
-
BinaryManifestEntry.Projection.create(projectedType).createEntry();
+ ProjectedManifestEntry projectedEntry =
+
ProjectedManifestEntry.Projection.create(projectedType).createEntry();
try (ManifestAvroReader reader =
new ManifestAvroReader(fileIO.newInputStream(path),
projectedType, null, null)) {
@@ -243,9 +243,9 @@ public class ManifestFileTest {
valid.getRow(5,
DataFileMeta.SCHEMA.getFieldCount())));
}
- try (CloseableIterator<BinaryManifestEntry> entries =
+ try (CloseableIterator<ProjectedManifestEntry> entries =
manifestFile.scan(
- manifest.fileName(),
BinaryManifestEntry.DELETE_ENTRY_PROJECTION)) {
+ manifest.fileName(),
ProjectedManifestEntry.DELETE_ENTRY_PROJECTION)) {
assertThatThrownBy(entries::hasNext)
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("not compatible");
@@ -492,11 +492,11 @@ public class ManifestFileTest {
List<ManifestEntry> entries = Arrays.asList(gen.next(), gen.next(),
gen.next());
ManifestFile manifestFile = createManifestFile(tempDir.toString(),
Long.MAX_VALUE);
ManifestFileMeta manifest = writeSingleManifest(manifestFile, entries);
- BinaryManifestEntry.Projection projection =
+ ProjectedManifestEntry.Projection projection =
projection(DataFileMeta.FILE_NAME, DataFileMeta.ROW_COUNT);
- List<BinaryManifestEntry> actual = new ArrayList<>();
+ List<ProjectedManifestEntry> actual = new ArrayList<>();
- try (CloseableIterator<BinaryManifestEntry> iterator =
+ try (CloseableIterator<ProjectedManifestEntry> iterator =
manifestFile.scan(manifest.fileName(), projection)) {
while (iterator.hasNext()) {
actual.add(iterator.next());
@@ -521,14 +521,14 @@ public class ManifestFileTest {
ManifestFile manifestFile = createManifestFile(tempDir.toString(),
Long.MAX_VALUE);
ManifestFileMeta manifest = writeSingleManifest(manifestFile, entries);
- try (CloseableIterator<BinaryManifestEntry> iterator =
+ try (CloseableIterator<ProjectedManifestEntry> iterator =
manifestFile.scan(manifest.fileName(),
projection(DataFileMeta.FILE_NAME))) {
assertThat(iterator.hasNext()).isTrue();
- BinaryManifestEntry first = iterator.next();
+ ProjectedManifestEntry first = iterator.next();
assertThat(first.fileName()).isEqualTo(entries.get(0).fileName());
assertThat(iterator.hasNext()).isTrue();
- BinaryManifestEntry second = iterator.next();
+ ProjectedManifestEntry second = iterator.next();
assertThat(second).isNotSameAs(first);
assertThat(second.fileName()).isEqualTo(entries.get(1).fileName());
assertThat(first.fileName()).isEqualTo(entries.get(0).fileName());
@@ -540,12 +540,12 @@ public class ManifestFileTest {
List<ManifestEntry> entries = Arrays.asList(gen.next(), gen.next(),
gen.next());
ManifestFile manifestFile = createManifestFile(tempDir.toString(),
Long.MAX_VALUE);
ManifestFileMeta manifest = writeSingleManifest(manifestFile, entries);
- List<BinaryManifestEntry> retained = new ArrayList<>();
+ List<ProjectedManifestEntry> retained = new ArrayList<>();
- try (CloseableIterator<BinaryManifestEntry> iterator =
+ try (CloseableIterator<ProjectedManifestEntry> iterator =
manifestFile.scan(manifest.fileName(),
projection(DataFileMeta.FILE_NAME))) {
while (iterator.hasNext()) {
- BinaryManifestEntry entry = iterator.next();
+ ProjectedManifestEntry entry = iterator.next();
retained.add(entry);
break;
}
@@ -561,16 +561,16 @@ public class ManifestFileTest {
ManifestFile manifestFile = createManifestFile(tempDir.toString(),
Long.MAX_VALUE);
ManifestFileMeta manifest = writeSingleManifest(manifestFile, entries);
RuntimeException failure = new RuntimeException("Expected processing
failure.");
- List<BinaryManifestEntry> retained = new ArrayList<>();
+ List<ProjectedManifestEntry> retained = new ArrayList<>();
assertThatThrownBy(
() -> {
- try (CloseableIterator<BinaryManifestEntry>
iterator =
+ try (CloseableIterator<ProjectedManifestEntry>
iterator =
manifestFile.scan(
manifest.fileName(),
projection(DataFileMeta.FILE_NAME))) {
assertThat(iterator.hasNext()).isTrue();
- BinaryManifestEntry entry = iterator.next();
+ ProjectedManifestEntry entry = iterator.next();
retained.add(entry);
throw failure;
}
@@ -631,7 +631,7 @@ public class ManifestFileTest {
return manifests.get(0);
}
- private BinaryManifestEntry.Projection projection(String...
projectedFileFields) {
+ private ProjectedManifestEntry.Projection projection(String...
projectedFileFields) {
RowType manifestType = ManifestEntry.MANIFEST_ROW_TYPE;
List<DataField> fields =
Arrays.asList(
@@ -640,7 +640,7 @@ public class ManifestFileTest {
manifestType
.getField(ManifestEntry.FILE)
.newType(DataFileMeta.SCHEMA.project(projectedFileFields)));
- return BinaryManifestEntry.Projection.create(new RowType(false,
fields));
+ return ProjectedManifestEntry.Projection.create(new RowType(false,
fields));
}
private void checkRollingFiles(
diff --git
a/paimon-core/src/test/java/org/apache/paimon/manifest/BinaryManifestEntryTest.java
b/paimon-core/src/test/java/org/apache/paimon/manifest/ProjectedManifestEntryTest.java
similarity index 93%
rename from
paimon-core/src/test/java/org/apache/paimon/manifest/BinaryManifestEntryTest.java
rename to
paimon-core/src/test/java/org/apache/paimon/manifest/ProjectedManifestEntryTest.java
index e60615a1ca..c78e782367 100644
---
a/paimon-core/src/test/java/org/apache/paimon/manifest/BinaryManifestEntryTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/manifest/ProjectedManifestEntryTest.java
@@ -23,8 +23,8 @@ import org.apache.paimon.data.BinaryRowWriter;
import org.apache.paimon.data.BinaryString;
import org.apache.paimon.data.GenericArray;
import org.apache.paimon.data.GenericRow;
-import org.apache.paimon.io.BinaryDataFileMeta;
import org.apache.paimon.io.DataFileMeta;
+import org.apache.paimon.io.ProjectedDataFileMeta;
import org.apache.paimon.types.DataField;
import org.apache.paimon.types.RowType;
@@ -38,13 +38,13 @@ import static
org.apache.paimon.utils.SerializationUtils.serializeBinaryRow;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-/** Tests for {@link BinaryManifestEntry}. */
-public class BinaryManifestEntryTest {
+/** Tests for {@link ProjectedManifestEntry}. */
+public class ProjectedManifestEntryTest {
@Test
void testImplementsProjectedManifestEntry() {
BinaryRow partition = BinaryRow.EMPTY_ROW;
- BinaryManifestEntry entry =
+ ProjectedManifestEntry entry =
projection(
true,
DataFileMeta.FILE_NAME,
@@ -84,7 +84,7 @@ public class BinaryManifestEntryTest {
assertThat(manifestEntry.rowCount()).isEqualTo(7L);
assertThat(manifestEntry.firstRowId()).isEqualTo(11L);
assertThat(manifestEntry.identifier().embeddedIndex).containsExactly(1, 2);
- BinaryDataFileMeta file = entry.file();
+ ProjectedDataFileMeta file = entry.file();
assertThat(manifestEntry.file()).isSameAs(file);
assertThat(file.fileName()).isEqualTo("data.parquet");
assertThat(file.rowCount()).isEqualTo(7L);
@@ -153,8 +153,8 @@ public class BinaryManifestEntryTest {
manifestType.getField(ManifestEntry.TOTAL_BUCKETS),
manifestType.getField(ManifestEntry.PARTITION),
manifestType.getField(ManifestEntry.KIND)));
- BinaryManifestEntry entry =
- BinaryManifestEntry.Projection.create(projectedType)
+ ProjectedManifestEntry entry =
+ ProjectedManifestEntry.Projection.create(projectedType)
.createEntry()
.replace(
GenericRow.of(
@@ -178,13 +178,13 @@ public class BinaryManifestEntryTest {
@Test
void testReusesAndClearsBinaryViews() {
- BinaryManifestEntry entry = projection(false,
DataFileMeta.FILE_NAME).createEntry();
+ ProjectedManifestEntry entry = projection(false,
DataFileMeta.FILE_NAME).createEntry();
entry.replace(
GenericRow.of(
FileKind.ADD.toByteValue(),
serializeBinaryRow(BinaryRow.EMPTY_ROW),
GenericRow.of(BinaryString.fromString("first.parquet"))));
- BinaryDataFileMeta file = entry.file();
+ ProjectedDataFileMeta file = entry.file();
assertThat(file.fileName()).isEqualTo("first.parquet");
entry.replace(
@@ -206,7 +206,7 @@ public class BinaryManifestEntryTest {
@Test
void testDoesNotReusePartitionAndUpdatesPartitionedIdentifier() {
- BinaryManifestEntry entry =
+ ProjectedManifestEntry entry =
projection(
true,
DataFileMeta.FILE_NAME,
@@ -240,8 +240,8 @@ public class BinaryManifestEntryTest {
false,
java.util.Collections.singletonList(
manifestType.getField(ManifestEntry.KIND)));
- BinaryManifestEntry entry =
- BinaryManifestEntry.Projection.create(projectedType)
+ ProjectedManifestEntry entry =
+ ProjectedManifestEntry.Projection.create(projectedType)
.createEntry()
.replace(GenericRow.of(FileKind.ADD.toByteValue()));
@@ -257,8 +257,8 @@ public class BinaryManifestEntryTest {
false,
java.util.Collections.singletonList(
manifestType.getField(ManifestEntry.KIND)));
- BinaryManifestEntry entry =
- BinaryManifestEntry.Projection.create(projectedType)
+ ProjectedManifestEntry entry =
+ ProjectedManifestEntry.Projection.create(projectedType)
.createEntry()
.replace(GenericRow.of((byte) 99));
@@ -266,7 +266,7 @@ public class BinaryManifestEntryTest {
assertThat(entry.isDelete()).isFalse();
}
- private static BinaryManifestEntry.Projection projection(
+ private static ProjectedManifestEntry.Projection projection(
boolean includeBucket, String... projectedFileFields) {
RowType manifestType = ManifestEntry.MANIFEST_ROW_TYPE;
List<DataField> fields = new ArrayList<>();
@@ -279,7 +279,7 @@ public class BinaryManifestEntryTest {
manifestType
.getField(ManifestEntry.FILE)
.newType(DataFileMeta.SCHEMA.project(projectedFileFields)));
- return BinaryManifestEntry.Projection.create(new RowType(false,
fields));
+ return ProjectedManifestEntry.Projection.create(new RowType(false,
fields));
}
private static GenericRow identityRow(BinaryRow partition) {