ernvalentino commented on a change in pull request #14644:
URL: https://github.com/apache/beam/pull/14644#discussion_r621437224



##########
File path: 
sdks/java/io/parquet/src/test/java/org/apache/beam/sdk/io/parquet/ParquetIOTest.java
##########
@@ -506,6 +506,53 @@ public void 
testWriteAndReadwithSplitUsingReflectDataSchemaWithDataModel() {
     readPipeline.run().waitUntilFinish();
   }
 
+  @Test
+  public void testWriteAndReadUsingGenericDataSchemaWithDataModel() {
+    Schema schema = new Schema.Parser().parse(SCHEMA_STRING);
+
+    List<GenericRecord> records = generateGenericRecords(1000);
+    mainPipeline
+        .apply(Create.of(records).withCoder(AvroCoder.of(schema)))
+        .apply(
+            FileIO.<GenericRecord>write()
+                
.via(ParquetIO.sink(schema).withAvroDataModel(GenericData.get()))
+                .to(temporaryFolder.getRoot().getAbsolutePath()));
+    mainPipeline.run().waitUntilFinish();
+
+    PCollection<GenericRecord> readBack =
+        readPipeline.apply(
+            ParquetIO.read(schema)
+                .withAvroDataModel(GenericData.get())
+                .from(temporaryFolder.getRoot().getAbsolutePath() + "/*"));
+
+    PAssert.that(readBack).containsInAnyOrder(records);
+    readPipeline.run().waitUntilFinish();
+  }
+
+  @Test
+  public void testWriteAndReadwithSplitUsingGenericDataSchemaWithDataModel() {

Review comment:
       I am not sure. I saw for the `SpecificData` use case there is the test 
for both so I just replicated the tests for the `GenericData`




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

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


Reply via email to