Aggarwal-Raghav commented on code in PR #6856:
URL: https://github.com/apache/hive/pull/6856#discussion_r4222791283
##########
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/data/GenericAppenderHelper.java:
##########
@@ -84,27 +84,23 @@ public DataFile writeFile(StructLike partition,
List<Record> records) throws IOE
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 (FileFormat.ORC.equals(format)) {
- appenderFactory.setAll(conf.getValByRegex(ORC_CONFIG_PREFIX));
+ builder.writerProperties(conf.getValByRegex(ORC_CONFIG_PREFIX));
}
- FileAppender<Record> appender = appenderFactory.newAppender(
- Files.localOutput(file), format);
- try (FileAppender<Record> fileAppender = appender) {
- fileAppender.addAll(records);
+ FileWriterFactory<Record> writerFactory = builder.build();
+ DataWriter<Record> appender = writerFactory.newDataWriter(
+ table.encryption().encrypt(Files.localOutput(file)), table.spec(),
partition);
+ try (appender) {
+ for (Record r : records) {
Review Comment:
I can do that, I don't have any concern with that, its just upstream iceberg
has the same code as we have, Is it ok to diverge?
https://github.com/apache/iceberg/blob/213a4b557db8c0a9b1eea90b908a4e6f3b1cbdf5/data/src/test/java/org/apache/iceberg/data/GenericAppenderHelper.java#L128-L134
--
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]