lidavidm commented on code in PR #258:
URL: https://github.com/apache/arrow-cookbook/pull/258#discussion_r995894375
##########
.github/workflows/test_java_linux_cookbook.yml:
##########
@@ -39,10 +39,11 @@ jobs:
java-version: [ '11', '17', '18' ]
arrow_nightly: ['0', '1']
exclude:
- - java-version: '11'
- arrow_nightly: '1'
- - java-version: '17'
- arrow_nightly: '1'
+ - arrow_nightly: '0'
+# - java-version: '11'
+# arrow_nightly: '1'
+# - java-version: '17'
+# arrow_nightly: '1'
Review Comment:
Why do we have commented-out code here?
##########
java/CONTRIBUTING.rst:
##########
@@ -69,6 +80,38 @@ Run ``make javatest`` from the cookbook root directory
to verify that the code for all the recipes runs correctly
and provides the expected output.
+.. code-block:: bash
+
+ $ cd arrow-cookbook
+ $ # SDK 11+
+ $ java --version
+ $ jshell --version
+ $ make javatest
+ ...
+ 1 items passed all tests:
+ 7 tests in default
+ 7 tests in 1 items.
+ 7 passed and 0 failed.
+ Test passed.
+ ...
+ Doctest summary
+ ===============
+ 44 tests
+ 0 failures in tests
+ 0 failures in setup code
+ 0 failures in cleanup code
+ build succeeded.
+
+Please note: In case you need to test the recipes with nightly version
Review Comment:
Isn't this documented above?
##########
java/CONTRIBUTING.rst:
##########
@@ -69,6 +80,38 @@ Run ``make javatest`` from the cookbook root directory
to verify that the code for all the recipes runs correctly
and provides the expected output.
+.. code-block:: bash
Review Comment:
I'm not sure what value this adds
##########
java/source/flight.rst:
##########
@@ -279,6 +279,8 @@ Flight Client and Server
}
} catch (InterruptedException e) {
e.printStackTrace();
+ } catch (Exception e) {
Review Comment:
Consolidate the catches?
##########
java/source/dataset.rst:
##########
@@ -213,6 +213,84 @@ Query Data Content For File
2 Gladis
3 Juan
+Let's try to read a Parquet file with gzip compression and 3 row groups:
+
+.. code-block::
+
+ $ parquet-tools meta data4_3rg_gzip.parquet
+
+ file schema: schema
+ age: OPTIONAL INT64 R:0 D:1
+ name: OPTIONAL BINARY L:STRING R:0 D:1
+ row group 1: RC:4 TS:182 OFFSET:4
+ row group 2: RC:4 TS:190 OFFSET:420
+ row group 3: RC:3 TS:179 OFFSET:838
+
+.. testcode::
+
+ import org.apache.arrow.dataset.file.FileFormat;
+ import org.apache.arrow.dataset.file.FileSystemDatasetFactory;
+ import org.apache.arrow.dataset.jni.NativeMemoryPool;
+ import org.apache.arrow.dataset.scanner.ScanOptions;
+ import org.apache.arrow.dataset.scanner.Scanner;
+ import org.apache.arrow.dataset.source.Dataset;
+ import org.apache.arrow.dataset.source.DatasetFactory;
+ import org.apache.arrow.memory.BufferAllocator;
+ import org.apache.arrow.memory.RootAllocator;
+ import org.apache.arrow.vector.VectorSchemaRoot;
+ import org.apache.arrow.vector.ipc.ArrowReader;
+
+ import java.io.IOException;
+
+ String uri = "file:" + System.getProperty("user.dir") +
"/thirdpartydeps/parquetfiles/data4_3rg_gzip.parquet";
+ ScanOptions options = new ScanOptions(/*batchSize*/ 32768);
+ try (
+ BufferAllocator allocator = new RootAllocator();
+ DatasetFactory datasetFactory = new FileSystemDatasetFactory(allocator,
NativeMemoryPool.getDefault(), FileFormat.PARQUET, uri);
+ Dataset dataset = datasetFactory.finish();
+ Scanner scanner = dataset.newScan(options)
+ ) {
+ scanner.scan().forEach(scanTask -> {
+ try (ArrowReader reader = scanTask.execute()) {
Review Comment:
Didn't we change this API?
--
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]