Skip to content

Commit

Permalink
Update StructReader constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
wmoustafa committed Oct 8, 2023
1 parent 7ccf868 commit 057366b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
9 changes: 0 additions & 9 deletions .palantir/revapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<S>::<init>(java.util.List<org.apache.iceberg.avro.ValueReader<?>>,\
\ org.apache.iceberg.types.Types.StructType, java.util.Map<java.lang.Integer,\
\ ?>)"
new: "method void org.apache.iceberg.avro.ValueReaders.StructReader<S>::<init>(java.util.List<org.apache.iceberg.avro.ValueReader<?>>,\
\ org.apache.iceberg.types.Types.StructType, java.util.Map<java.lang.Integer,\
\ ?>, java.util.Map<java.lang.Integer, ?>)"
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<T>::offer(===T===)\
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/java/org/apache/iceberg/avro/ValueReaders.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -600,6 +601,11 @@ protected StructReader(List<ValueReader<?>> readers, Schema schema) {
this.defaultValues = new Object[0];
}

protected StructReader(
List<ValueReader<?>> readers, Types.StructType struct, Map<Integer, ?> idToConstant) {
this(readers, struct, idToConstant, ImmutableMap.of());
}

protected StructReader(
List<ValueReader<?>> readers,
Types.StructType struct,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -289,7 +288,7 @@ private static class StructReader extends ValueReaders.StructReader<RowData> {
private StructReader(
List<ValueReader<?>> readers, Types.StructType struct, Map<Integer, ?> idToConstant) {
// TODO: Support passing default value map.
super(readers, struct, idToConstant, ImmutableMap.of());
super(readers, struct, idToConstant);
this.numFields = readers.size();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -256,7 +255,7 @@ static class StructReader extends ValueReaders.StructReader<InternalRow> {
protected StructReader(
List<ValueReader<?>> readers, Types.StructType struct, Map<Integer, ?> idToConstant) {
// TODO: Support passing default value map
super(readers, struct, idToConstant, ImmutableMap.of());
super(readers, struct, idToConstant);
this.numFields = readers.size();
}

Expand Down

0 comments on commit 057366b

Please sign in to comment.