garyli1019 commented on a change in pull request #949: HUDI-40 Support Parquet 
in delta streamer
URL: https://github.com/apache/incubator-hudi/pull/949#discussion_r335659746
 
 

 ##########
 File path: 
hudi-utilities/src/test/java/org/apache/hudi/utilities/UtilitiesTestBase.java
 ##########
 @@ -178,13 +186,40 @@ public static void saveStringsToDFS(String[] lines, 
FileSystem fs, String target
       os.close();
     }
 
+    public static void saveParquetToDFS(List<GenericRecord> records, Path 
targetFile) throws IOException {
+      ParquetWriter<GenericRecord> writer = 
AvroParquetWriter.<GenericRecord>builder(targetFile)
+          
.withSchema(HoodieTestDataGenerator.avroSchema).withConf(HoodieTestUtils.getDefaultHadoopConf()).build();
+      for (GenericRecord record : records) {
+        writer.write(record);
+      }
+      writer.close();
 
 Review comment:
   this is good to know!

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


With regards,
Apache Git Services

Reply via email to