You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/13 20:05:59 UTC

[GitHub] [arrow-cookbook] lidavidm commented on a diff in pull request #207: [Java] Parquet reading example fails with Arrow v8.0

lidavidm commented on code in PR #207:
URL: https://github.com/apache/arrow-cookbook/pull/207#discussion_r872753301


##########
java/source/demo/pom.xml:
##########
@@ -21,7 +21,7 @@
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
         <maven.compiler.target>8</maven.compiler.target>
-        <arrow.version>7.0.0</arrow.version>
+        <arrow.version>8.0.0</arrow.version>

Review Comment:
   We need to get this added to the list of post-release tasks and/or make it one of the things we check as part of release.



##########
java/source/dataset.rst:
##########
@@ -275,11 +302,19 @@ In case we need to project only certain columns we could configure ScanOptions w
     ){
         scanner.scan().forEach(scanTask-> {
             VectorLoader loader = new VectorLoader(vsr);
-            scanTask.execute().forEachRemaining(arrowRecordBatch -> {
-                loader.load(arrowRecordBatch);
-                System.out.print(vsr.contentToTSVString());
-                arrowRecordBatch.close();
-            });
+            try(ArrowReader reader = scanTask.execute()){
+                while (reader.loadNextBatch()) {
+                    try(VectorSchemaRoot root = reader.getVectorSchemaRoot()) {
+                        final VectorUnloader unloader = new VectorUnloader(root);
+                        try(ArrowRecordBatch arrowRecordBatch = unloader.getRecordBatch()){
+                            loader.load(arrowRecordBatch);
+                            System.out.print(vsr.contentToTSVString());

Review Comment:
   nit: why not just `root.contentToTSVString()`? Is there a need to demonstrate VectorLoader/VectorUnloader here?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org