Skip to content

Commit

Permalink
Fix revAPI failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ajantha-bhat committed Jan 6, 2025
1 parent 8c79e8e commit 233a00b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
22 changes: 22 additions & 0 deletions .palantir/revapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,28 @@ acceptedBreaks:
\ java.util.function.Function<T, java.lang.Long>, org.apache.iceberg.io.CloseableIterable<java.lang.Long>,\
\ java.util.function.Consumer<T>)"
justification: "Removing deprecated code"
org.apache.iceberg:iceberg-parquet:
- code: "java.method.abstractMethodAdded"
new: "method org.apache.iceberg.parquet.ParquetValueReaders.PrimitiveReader<?>\
\ org.apache.iceberg.data.parquet.BaseParquetReaders<T>::fixedReader(org.apache.parquet.column.ColumnDescriptor)"
justification: "{Refactor Parquet reader and writer}"
- code: "java.method.abstractMethodAdded"
new: "method org.apache.iceberg.parquet.ParquetValueReaders.PrimitiveReader<?>\
\ org.apache.iceberg.data.parquet.BaseParquetReaders<T>::int96Reader(org.apache.parquet.column.ColumnDescriptor)"
justification: "{Refactor Parquet reader and writer}"
- code: "java.method.abstractMethodAdded"
new: "method org.apache.iceberg.parquet.ParquetValueWriters.PrimitiveWriter<?>\
\ org.apache.iceberg.data.parquet.BaseParquetWriter<T>::fixedWriter(org.apache.parquet.column.ColumnDescriptor)"
justification: "{Refactor Parquet reader and writer}"
- code: "java.method.abstractMethodAdded"
new: "method org.apache.parquet.schema.LogicalTypeAnnotation.LogicalTypeAnnotationVisitor<org.apache.iceberg.parquet.ParquetValueReader<?>>\
\ org.apache.iceberg.data.parquet.BaseParquetReaders<T>::logicalTypeReaderVisitor(org.apache.parquet.column.ColumnDescriptor,\
\ org.apache.iceberg.types.Type.PrimitiveType, org.apache.parquet.schema.PrimitiveType)"
justification: "{Refactor Parquet reader and writer}"
- code: "java.method.abstractMethodAdded"
new: "method org.apache.parquet.schema.LogicalTypeAnnotation.LogicalTypeAnnotationVisitor<org.apache.iceberg.parquet.ParquetValueWriters.PrimitiveWriter<?>>\
\ org.apache.iceberg.data.parquet.BaseParquetWriter<T>::logicalTypeWriterVisitor(org.apache.parquet.column.ColumnDescriptor)"
justification: "{Refactor Parquet reader and writer}"
apache-iceberg-0.14.0:
org.apache.iceberg:iceberg-api:
- code: "java.class.defaultSerializationChanged"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.file.Path;
import java.util.Comparator;
import java.util.List;
import java.util.UUID;
import org.apache.iceberg.DataFile;
Expand All @@ -36,14 +37,14 @@
import org.apache.iceberg.Schema;
import org.apache.iceberg.StructLike;
import org.apache.iceberg.data.GenericRecord;
import org.apache.iceberg.data.Record;
import org.apache.iceberg.data.parquet.InternalReader;
import org.apache.iceberg.data.parquet.InternalWriter;
import org.apache.iceberg.expressions.Literal;
import org.apache.iceberg.io.CloseableIterable;
import org.apache.iceberg.io.DataWriter;
import org.apache.iceberg.io.OutputFile;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
import org.apache.iceberg.types.Comparators;
import org.apache.iceberg.types.Types;
import org.apache.iceberg.util.StructProjection;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -118,15 +119,16 @@ public void testDataWriter() throws IOException {
assertThat(dataFile.partition().size()).as("Partition should be empty").isEqualTo(0);
assertThat(dataFile.keyMetadata()).as("Key metadata should be null").isNull();

List<Record> writtenRecords;
try (CloseableIterable<Record> reader =
List<StructLike> writtenRecords;
try (CloseableIterable<StructLike> reader =
Parquet.read(file.toInputFile())
.project(schema)
.createReaderFunc(fileSchema -> InternalReader.buildReader(schema, fileSchema))
.build()) {
writtenRecords = Lists.newArrayList(reader);
}
assertThat(writtenRecords).hasSize(1);
assertThat(writtenRecords.get(0)).isEqualTo(record);
Comparator<StructLike> structLikeComparator = Comparators.forType(schema.asStruct());
assertThat(structLikeComparator.compare(writtenRecords.get(0), row)).isZero();
}
}

0 comments on commit 233a00b

Please sign in to comment.