zhztheplayer commented on code in PR #10883:
URL: https://github.com/apache/arrow/pull/10883#discussion_r857768879
##########
java/dataset/src/test/java/org/apache/arrow/dataset/TestDataset.java:
##########
@@ -56,15 +62,31 @@ protected RootAllocator rootAllocator() {
protected List<ArrowRecordBatch> collectResultFromFactory(DatasetFactory
factory, ScanOptions options) {
final Dataset dataset = factory.finish();
final Scanner scanner = dataset.newScan(options);
- final List<ArrowRecordBatch> ret = stream(scanner.scan())
- .flatMap(t -> stream(t.execute()))
- .collect(Collectors.toList());
try {
Review Comment:
I tried to factor out as try-finally but it seems that it better requires
some common changes to AutoCloseables.java.
See my draft:
https://github.com/zhztheplayer/arrow-1/commit/c460f67bc893c8f1559c254965076358cd5332ee
Do you think we can have another ticket for the changes too?
--
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]