deniskuzZ commented on code in PR #6856:
URL: https://github.com/apache/hive/pull/6856#discussion_r4245313904


##########
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/data/GenericAppenderHelper.java:
##########
@@ -66,45 +81,68 @@ public void appendToTable(DataFile... dataFiles) {
     append.commit();
   }
 
+  public void appendToTable(DataFile... dataFiles) {
+    appendToTable(null, dataFiles);
+  }
+
   public void appendToTable(List<Record> records) throws IOException {
-    appendToTable(null, records);
+    appendToTable(null, null, records);
+  }
+
+  public void appendToTable(String branch, List<Record> records) throws 
IOException {
+    appendToTable(null, branch, records);
+  }
+
+  public void appendToTable(StructLike partition, String branch, List<Record> 
records)
+      throws IOException {
+    appendToTable(branch, writeFile(partition, records));
   }
 
   public void appendToTable(StructLike partition, List<Record> records) throws 
IOException {
     appendToTable(writeFile(partition, records));
   }
 
+  public DataFile writeFile(List<Record> records) throws IOException {
+    Preconditions.checkNotNull(table, "table not set");
+    File file = temp.resolve("generic-appender-test-" + 
UUID.randomUUID()).toFile();
+    return appendToLocalFile(table, file, fileFormat, null, records, conf);
+  }
+
   public DataFile writeFile(StructLike partition, List<Record> records) throws 
IOException {
     Preconditions.checkNotNull(table, "table not set");
-    File file = tmp.newFile();
-    Assert.assertTrue(file.delete());
+    File file =
+        temp.resolve("generic-appender-partition-test-" + 
UUID.randomUUID()).toFile();
     return appendToLocalFile(table, file, fileFormat, partition, records, 
conf);
   }
 
-  private static DataFile appendToLocalFile(Table table, File file, FileFormat 
format, StructLike partition,
-      List<Record> records, Configuration conf)
+  private static DataFile appendToLocalFile(
+      Table table,
+      File file,
+      FileFormat format,
+      StructLike partition,
+      List<Record> records,
+      Configuration conf)
       throws IOException {
-    GenericAppenderFactory appenderFactory = new 
GenericAppenderFactory(table.schema());
+    GenericFileWriterFactory.Builder builder =
+        new GenericFileWriterFactory.Builder(table).dataFileFormat(format);
+
+    // Push down ORC related settings to appender if there are any

Review Comment:
    Push down ORC and Parquet ?



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