rdblue commented on a change in pull request #4083:
URL: https://github.com/apache/iceberg/pull/4083#discussion_r803844861
##########
File path: core/src/test/java/org/apache/iceberg/avro/TestAvroDataWriter.java
##########
@@ -68,21 +71,34 @@ public void createRecords() {
@Test
public void testDataWriter() throws IOException {
- OutputFile file = Files.localOutput(temp.newFile());
+ List<Map<String, String>> possibleAvroProperties =
generateAvroWriterProperties();
+ for (Map<String, String> avroProperties : possibleAvroProperties) {
+ validateAvroWriter(avroProperties);
+ }
+ }
+
+ private List<Map<String, String>> generateAvroWriterProperties() {
+ List<Map<String, String>> properties = Lists.newArrayList();
+ for (Codec codec : Codec.values()) {
+ properties.add(ImmutableMap.of(AVRO_COMPRESSION, codec.name()));
+ }
+ return properties;
+ }
+ private void validateAvroWriter(Map<String, String> avroWriterProperties)
throws IOException {
+ OutputFile file = Files.localOutput(temp.newFile());
SortOrder sortOrder = SortOrder.builderFor(SCHEMA)
.withOrderId(10)
.asc("id")
.build();
-
DataWriter<Record> dataWriter = Avro.writeData(file)
.schema(SCHEMA)
.createWriterFunc(org.apache.iceberg.data.avro.DataWriter::create)
.overwrite()
.withSpec(PartitionSpec.unpartitioned())
.withSortOrder(sortOrder)
+ .setAll(avroWriterProperties)
.build();
-
Review comment:
Can you please revert the whitespace changes?
--
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]