davisusanibar commented on code in PR #39681:
URL: https://github.com/apache/arrow/pull/39681#discussion_r1467078564


##########
java/dataset/src/test/java/org/apache/arrow/dataset/TestAllTypes.java:
##########
@@ -260,4 +266,29 @@ public void testAllTypesParquet() throws Exception {
       }
     }
   }
+
+  /*
+  The purpose of this method is to refresh the data in alltypes-java.parquet 
as required:
+  
https://github.com/apache/arrow-testing/blob/master/data/parquet/alltypes-java.parquet
+   */
+  public static void main(String[] args) throws Exception {
+    TestAllTypes test = new TestAllTypes();
+    try (BufferAllocator allocator = new RootAllocator();
+         VectorSchemaRoot root = test.generateAllTypesVector(allocator)) {
+      byte[] featherData = test.serializeFile(root);
+      try (SeekableByteChannel channel = new 
ByteArrayReadableSeekableByteChannel(featherData);
+           ArrowStreamReader reader = new ArrowStreamReader(channel, 
allocator)) {
+        TMP.create();
+        final File writtenFolder = TMP.newFolder();
+        final String writtenParquet = writtenFolder.toURI().toString();
+        DatasetFileWriter.write(allocator, reader, FileFormat.PARQUET,
+                writtenParquet);
+        Objects.requireNonNull(writtenFolder.listFiles());
+        Files.move(writtenFolder.listFiles()[0].toPath(),
+                Paths.get(writtenFolder.toPath().toString(), 
"alltypes-java.parquet"));
+        System.out.println("The file data/parquet/alltypes-java.parquet should 
be updated with this new data: " +
+                writtenFolder.listFiles()[0].toURI());
+      }
+    }
+  }

Review Comment:
   Sure, I will clean and delete this section.



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

Reply via email to