nastra commented on code in PR #15334:
URL: https://github.com/apache/iceberg/pull/15334#discussion_r2813154765


##########
data/src/main/java/org/apache/iceberg/data/GenericFileWriterFactory.java:
##########
@@ -107,62 +130,163 @@ public class GenericFileWriterFactory extends 
BaseFileWriterFactory<Record> {
     super(
         table,
         dataFileFormat,
+        Record.class,
         dataSchema,
         dataSortOrder,
         deleteFileFormat,
         equalityFieldIds,
         equalityDeleteRowSchema,
         equalityDeleteSortOrder,
-        positionDeleteRowSchema);
+        ImmutableMap.of(),
+        dataSchema,
+        equalityDeleteRowSchema);
+    this.table = table;
+    this.format = dataFileFormat;
+    this.positionDeleteRowSchema = positionDeleteRowSchema;
   }
 
   static Builder builderFor(Table table) {
     return new Builder(table);
   }
 
-  @Override
+  /**
+   * @deprecated Since 1.10.0, will be removed in 1.11.0. It won't be called 
starting 1.10.0 as the
+   *     configuration is done by the {@link FormatModelRegistry}.
+   */
+  @Deprecated
   protected void configureDataWrite(Avro.DataWriteBuilder builder) {
-    builder.createWriterFunc(DataWriter::create);
+    throwUnsupportedOperationException();
   }
 
-  @Override
+  /**
+   * @deprecated Since 1.10.0, will be removed in 1.11.0. It won't be called 
starting 1.10.0 as the
+   *     configuration is done by the {@link FormatModelRegistry}.
+   */
+  @Deprecated
   protected void configureEqualityDelete(Avro.DeleteWriteBuilder builder) {
-    builder.createWriterFunc(DataWriter::create);
+    throwUnsupportedOperationException();
   }
 
-  @Override
+  /**
+   * @deprecated Since 1.10.0, will be removed in 1.11.0. It won't be called 
starting 1.10.0 as the
+   *     configuration is done by the {@link FormatModelRegistry}.
+   */
+  @Deprecated
   protected void configurePositionDelete(Avro.DeleteWriteBuilder builder) {
-    builder.createWriterFunc(DataWriter::create);
+    throwUnsupportedOperationException();
   }
 
-  @Override
+  /**
+   * @deprecated Since 1.10.0, will be removed in 1.11.0. It won't be called 
starting 1.10.0 as the
+   *     configuration is done by the {@link FormatModelRegistry}.
+   */
+  @Deprecated
   protected void configureDataWrite(Parquet.DataWriteBuilder builder) {
-    builder.createWriterFunc(GenericParquetWriter::create);
+    throwUnsupportedOperationException();
   }
 
-  @Override
+  /**
+   * @deprecated Since 1.10.0, will be removed in 1.11.0. It won't be called 
starting 1.10.0 as the
+   *     configuration is done by the {@link FormatModelRegistry}.
+   */
+  @Deprecated
   protected void configureEqualityDelete(Parquet.DeleteWriteBuilder builder) {
-    builder.createWriterFunc(GenericParquetWriter::create);
+    throwUnsupportedOperationException();
   }
 
-  @Override
+  /**
+   * @deprecated Since 1.10.0, will be removed in 1.11.0. It won't be called 
starting 1.10.0 as the
+   *     configuration is done by the {@link FormatModelRegistry}.
+   */
+  @Deprecated
   protected void configurePositionDelete(Parquet.DeleteWriteBuilder builder) {
-    builder.createWriterFunc(GenericParquetWriter::create);
+    throwUnsupportedOperationException();
   }
 
-  @Override
+  /**
+   * @deprecated Since 1.10.0, will be removed in 1.11.0. It won't be called 
starting 1.10.0 as the
+   *     configuration is done by the {@link FormatModelRegistry}.
+   */
+  @Deprecated
   protected void configureDataWrite(ORC.DataWriteBuilder builder) {
-    builder.createWriterFunc(GenericOrcWriter::buildWriter);
+    throwUnsupportedOperationException();
   }
 
-  @Override
+  /**
+   * @deprecated Since 1.10.0, will be removed in 1.11.0. It won't be called 
starting 1.10.0 as the
+   *     configuration is done by the {@link FormatModelRegistry}.
+   */
+  @Deprecated
   protected void configureEqualityDelete(ORC.DeleteWriteBuilder builder) {
-    builder.createWriterFunc(GenericOrcWriter::buildWriter);
+    throwUnsupportedOperationException();
   }
 
-  @Override
+  /**
+   * @deprecated Since 1.10.0, will be removed in 1.11.0. It won't be called 
starting 1.10.0 as the
+   *     configuration is done by the {@link FormatModelRegistry}.
+   */
+  @Deprecated
   protected void configurePositionDelete(ORC.DeleteWriteBuilder builder) {
-    builder.createWriterFunc(GenericOrcWriter::buildWriter);
+    throwUnsupportedOperationException();
+  }
+
+  private void throwUnsupportedOperationException() {
+    throw new UnsupportedOperationException(

Review Comment:
   should those methods be no-ops instead? Otherwise users will hit this 
exception when calling those methods. Typically when we deprecate something we 
keep/maintain the functionality without failing immediately



-- 
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