From 057366bf0d6a8807c56b71dff62a64f8315c1157 Mon Sep 17 00:00:00 2001 From: Walaa Eldin Moustafa Date: Sun, 8 Oct 2023 11:57:03 -0700 Subject: [PATCH] Update StructReader constructor --- .palantir/revapi.yml | 9 --------- .../main/java/org/apache/iceberg/avro/ValueReaders.java | 6 ++++++ .../org/apache/iceberg/flink/data/FlinkValueReaders.java | 3 +-- .../org/apache/iceberg/spark/data/SparkValueReaders.java | 3 +-- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.palantir/revapi.yml b/.palantir/revapi.yml index 7f541f658f7b..6c9659fdcd34 100644 --- a/.palantir/revapi.yml +++ b/.palantir/revapi.yml @@ -451,15 +451,6 @@ acceptedBreaks: - code: "java.field.removedWithConstant" old: "field org.apache.iceberg.TableProperties.HMS_TABLE_OWNER" justification: "Removing deprecations for 1.3.0" - - code: "java.method.numberOfParametersChanged" - old: "method void org.apache.iceberg.avro.ValueReaders.StructReader::(java.util.List>,\ - \ org.apache.iceberg.types.Types.StructType, java.util.Map)" - new: "method void org.apache.iceberg.avro.ValueReaders.StructReader::(java.util.List>,\ - \ org.apache.iceberg.types.Types.StructType, java.util.Map, java.util.Map)" - justification: "Added idToDefault parameter to accommodate passing the default\ - \ map from the specific reader" - code: "java.method.parameterTypeChanged" old: "parameter void org.apache.iceberg.actions.RewriteDataFilesCommitManager.CommitService::offer(===org.apache.iceberg.actions.RewriteFileGroup===)" new: "parameter void org.apache.iceberg.actions.BaseCommitService::offer(===T===)\ diff --git a/core/src/main/java/org/apache/iceberg/avro/ValueReaders.java b/core/src/main/java/org/apache/iceberg/avro/ValueReaders.java index 51a2214bd09c..65419b3dcc9b 100644 --- a/core/src/main/java/org/apache/iceberg/avro/ValueReaders.java +++ b/core/src/main/java/org/apache/iceberg/avro/ValueReaders.java @@ -42,6 +42,7 @@ import org.apache.avro.util.Utf8; import org.apache.iceberg.MetadataColumns; import org.apache.iceberg.common.DynConstructors; +import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.relocated.com.google.common.collect.Maps; import org.apache.iceberg.relocated.com.google.common.collect.Sets; @@ -600,6 +601,11 @@ protected StructReader(List> readers, Schema schema) { this.defaultValues = new Object[0]; } + protected StructReader( + List> readers, Types.StructType struct, Map idToConstant) { + this(readers, struct, idToConstant, ImmutableMap.of()); + } + protected StructReader( List> readers, Types.StructType struct, diff --git a/flink/v1.17/flink/src/main/java/org/apache/iceberg/flink/data/FlinkValueReaders.java b/flink/v1.17/flink/src/main/java/org/apache/iceberg/flink/data/FlinkValueReaders.java index 3e3be161b485..272813e937ba 100644 --- a/flink/v1.17/flink/src/main/java/org/apache/iceberg/flink/data/FlinkValueReaders.java +++ b/flink/v1.17/flink/src/main/java/org/apache/iceberg/flink/data/FlinkValueReaders.java @@ -37,7 +37,6 @@ import org.apache.flink.table.data.TimestampData; import org.apache.iceberg.avro.ValueReader; import org.apache.iceberg.avro.ValueReaders; -import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.relocated.com.google.common.collect.Maps; import org.apache.iceberg.types.Types; @@ -289,7 +288,7 @@ private static class StructReader extends ValueReaders.StructReader { private StructReader( List> readers, Types.StructType struct, Map idToConstant) { // TODO: Support passing default value map. - super(readers, struct, idToConstant, ImmutableMap.of()); + super(readers, struct, idToConstant); this.numFields = readers.size(); } diff --git a/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/data/SparkValueReaders.java b/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/data/SparkValueReaders.java index 0a95e168f353..13c2e11e39eb 100644 --- a/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/data/SparkValueReaders.java +++ b/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/data/SparkValueReaders.java @@ -30,7 +30,6 @@ import org.apache.avro.util.Utf8; import org.apache.iceberg.avro.ValueReader; import org.apache.iceberg.avro.ValueReaders; -import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.types.Types; import org.apache.iceberg.util.UUIDUtil; @@ -256,7 +255,7 @@ static class StructReader extends ValueReaders.StructReader { protected StructReader( List> readers, Types.StructType struct, Map idToConstant) { // TODO: Support passing default value map - super(readers, struct, idToConstant, ImmutableMap.of()); + super(readers, struct, idToConstant); this.numFields = readers.size(); }