rdblue commented on code in PR #15254:
URL: https://github.com/apache/iceberg/pull/15254#discussion_r2785254114


##########
core/src/main/java/org/apache/iceberg/avro/AvroFormatModel.java:
##########
@@ -0,0 +1,267 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg.avro;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.Map;
+import org.apache.avro.Schema;
+import org.apache.avro.io.DatumReader;
+import org.apache.avro.io.DatumWriter;
+import org.apache.iceberg.FileContent;
+import org.apache.iceberg.FileFormat;
+import org.apache.iceberg.MetricsConfig;
+import org.apache.iceberg.deletes.PositionDelete;
+import org.apache.iceberg.encryption.EncryptedOutputFile;
+import org.apache.iceberg.expressions.Expression;
+import org.apache.iceberg.formats.BaseFormatModel;
+import org.apache.iceberg.formats.ModelWriteBuilder;
+import org.apache.iceberg.formats.ReadBuilder;
+import org.apache.iceberg.io.CloseableIterable;
+import org.apache.iceberg.io.DeleteSchemaUtil;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+
+public class AvroFormatModel<D, S>
+    extends BaseFormatModel<D, S, DatumWriter<D>, DatumReader<D>, Schema> {
+
+  @SuppressWarnings("rawtypes")

Review Comment:
   We fixed this in the last PR as well, although it looks like I didn't catch 
that the "rawtypes" suppression was not removed (`FormatModelRegistry` line 
175). The problem is that `PositionDelete` is parameterized but this use is not.
   
   Since these changes need `Class<PositionDelete<D>>` in several places, 
should we add a static method to produce one?
   
   ```java
     // in PositionDelete.java
     @SuppressWarnings("unchecked")
     public static <T> Class<PositionDelete<T>> deleteClass() {
       return (Class<PositionDelete<T>>) (Class<?>) PositionDelete.class;
     }
   ```
   
   Then these methods don't need `rawtypes` or `unchecked` suppressions:
   
   ```java
     public static <D> AvroFormatModel<PositionDelete<D>, Object> forDelete() {
       return new AvroFormatModel<>(PositionDelete.deleteClass(), null, null, 
null);
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to