diff --git a/.palantir/revapi.yml b/.palantir/revapi.yml index 18c63fbe7bb1..4e2f5775579d 100644 --- a/.palantir/revapi.yml +++ b/.palantir/revapi.yml @@ -1171,6 +1171,28 @@ acceptedBreaks: \ java.util.function.Function, org.apache.iceberg.io.CloseableIterable,\ \ java.util.function.Consumer)" 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::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::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::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.data.parquet.BaseParquetReaders::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.data.parquet.BaseParquetWriter::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" diff --git a/parquet/src/test/java/org/apache/iceberg/parquet/TestInternalWriter.java b/parquet/src/test/java/org/apache/iceberg/parquet/TestInternalWriter.java index 3b21aca611de..79b4dbe19c65 100644 --- a/parquet/src/test/java/org/apache/iceberg/parquet/TestInternalWriter.java +++ b/parquet/src/test/java/org/apache/iceberg/parquet/TestInternalWriter.java @@ -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; @@ -36,7 +37,6 @@ 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; @@ -44,6 +44,7 @@ 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; @@ -118,8 +119,8 @@ 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 writtenRecords; - try (CloseableIterable reader = + List writtenRecords; + try (CloseableIterable reader = Parquet.read(file.toInputFile()) .project(schema) .createReaderFunc(fileSchema -> InternalReader.buildReader(schema, fileSchema)) @@ -127,6 +128,7 @@ public void testDataWriter() throws IOException { writtenRecords = Lists.newArrayList(reader); } assertThat(writtenRecords).hasSize(1); - assertThat(writtenRecords.get(0)).isEqualTo(record); + Comparator structLikeComparator = Comparators.forType(schema.asStruct()); + assertThat(structLikeComparator.compare(writtenRecords.get(0), row)).isZero(); } }