-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-11776: [Java][Dataset] Support writing to files within dataset scanner via JNI #10108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on JIRA? https://issues.apache.org/jira/browse/ARROW Opening JIRAs ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename pull request title in the following format? or See also: |
b099a13 to
056dd8b
Compare
056dd8b to
c9eee12
Compare
cpp/src/jni/dataset/jni_util.cc
Outdated
| std::vector<std::shared_ptr<Buffer>> buffers; | ||
| for (const auto& buffer : array_data->buffers) { | ||
| buffers.push_back(buffer); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like this loop and the loop below could be combinded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| arrow::Status ReservationListenableMemoryPool::Allocate(int64_t size, uint8_t** out) { | ||
| Status ReservationListenableMemoryPool::Allocate(int64_t size, uint8_t** out) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mixing style changes like this with new code makes reviews harder, please try to avoid large scale changes like this in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion.
| @@ -0,0 +1,55 @@ | |||
| // Licensed to the Apache Software Foundation (ASF) under one | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we using protos for this information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In particular this for the most part looks like it replicates data already defined in flatbuffers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrated to flatbuffers in PR #10201
| checkParquetReadResult(schema, writeSupport.getWrittenRecords(), datum); | ||
|
|
||
| AutoCloseables.close(datum); | ||
| AutoCloseables.close(factory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
combine this line with the previous? close can take multiple parameters i believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not able to be combined directly. The first line calls code
arrow/java/memory/memory-core/src/main/java/org/apache/arrow/util/AutoCloseables.java
Lines 82 to 109 in 0a3cbd0
| public static void close(Iterable<? extends AutoCloseable> ac) throws Exception { | |
| // this method can be called on a single object if it implements Iterable<AutoCloseable> | |
| // like for example VectorContainer make sure we handle that properly | |
| if (ac == null) { | |
| return; | |
| } else if (ac instanceof AutoCloseable) { | |
| ((AutoCloseable) ac).close(); | |
| return; | |
| } | |
| Exception topLevelException = null; | |
| for (AutoCloseable closeable : ac) { | |
| try { | |
| if (closeable != null) { | |
| closeable.close(); | |
| } | |
| } catch (Exception e) { | |
| if (topLevelException == null) { | |
| topLevelException = e; | |
| } else if (e != topLevelException) { | |
| topLevelException.addSuppressed(e); | |
| } | |
| } | |
| } | |
| if (topLevelException != null) { | |
| throw topLevelException; | |
| } | |
| } |
second line calls
arrow/java/memory/memory-core/src/main/java/org/apache/arrow/util/AutoCloseables.java
Lines 74 to 76 in 0a3cbd0
| public static void close(AutoCloseable... autoCloseables) throws Exception { | |
| close(Arrays.asList(autoCloseables)); | |
| } |
|
Hi @emkornfield (and anyone who has been reviewing), sorry I made a mistake of deleting the original branch and the PR is now not able to reopen. Now I can only open a new PR: #10201. Sorry again for that. |
https://issues.apache.org/jira/browse/ARROW-11776