Repository navigation
Conversation
|
@pudidic , do we need a unit test? |
| } | ||
|
|
||
| @Override | ||
| protected void writeRecordBatch(ArrowRecordBatch batch) throws IOException { |
There was a problem hiding this comment.
I am not sure how this method helps in saving memory overhead as mentioned in PR description. Can you please elaborate on the usage of this method?
There was a problem hiding this comment.
If you trace the data flow for ArrowStreamWriter, the line inherited by ArrowWriter.writeRecordBatch:
recordBlocks.add(block);
accumulates ArrowBlock in a list that is never used by ArrowStreamWriter.
The recordBlocks list is used by a different sub-class of ArrowWriter at ArrowFileWriter.endInternal.
This was confirmed by @elahrvivaz on the dev list.
|
@pudidic |
|
+1 to @siddharthteotia suggestion for a unit test |
|
@siddharthteotia, @EricWohlstadter no problem. I'm applying your feedbacks and merging with latest master branch changes. Thanks! |
BryanCutler
left a comment
There was a problem hiding this comment.
LGTM, thanks @pudidic for the fix and @EricWohlstadter for reporting!
|
Looks like the same issue for DictionaryBatches. I added https://issues.apache.org/jira/browse/ARROW-2645 to track. |
|
merged to master |
… specifc logic Related to #2079 , the DictionaryBatch `ArrowBlock`s were being accumulated in the base class and used by `ArrowFileWriter` but not `ArrowStreamWriter`. This refactors the `ArrowWriter` to move Lists of ArrowBlocks from the base class to only `ArrowFileWriter`. Moved tests counting ArrowBlocks written from ArrowStreamWriter tests to ArrowFileWriter. Author: Bryan Cutler <cutlerb@gmail.com> Closes #2090 from BryanCutler/java-ArrowStreamWriter-accum-DictionaryBlocks-ARROW-2645 and squashes the following commits: fc7f061 <Bryan Cutler> added comment about saving ArrowBlocks 5e4711a <Bryan Cutler> Moved lists of ArrowBlocks in ArrowWriter base class to ArrowFileWriter where they are used
…not use them ArrowStreamWriter inherits from ArrowWriter the behavior of accumulating an ArrowBlock for each ArrowRecordBatch that is written. But this data is never used in the context of ArrowStreamWriter. writeRecordBatch can be overridden in ArrowStreamWriter to avoid adding the memory overhead. Author: Teddy Choi <pudidic@gmail.com> Closes apache#2079 from pudidic/ARROW-2632 and squashes the following commits: 70ecf08 <Teddy Choi> Preserve logging. Add more list size checks in unit tests. 7b289d4 <Teddy Choi> ARROW-2632: ArrowStreamWriter accumulates ArrowBlock but does not use them
… specifc logic Related to apache#2079 , the DictionaryBatch `ArrowBlock`s were being accumulated in the base class and used by `ArrowFileWriter` but not `ArrowStreamWriter`. This refactors the `ArrowWriter` to move Lists of ArrowBlocks from the base class to only `ArrowFileWriter`. Moved tests counting ArrowBlocks written from ArrowStreamWriter tests to ArrowFileWriter. Author: Bryan Cutler <cutlerb@gmail.com> Closes apache#2090 from BryanCutler/java-ArrowStreamWriter-accum-DictionaryBlocks-ARROW-2645 and squashes the following commits: fc7f061 <Bryan Cutler> added comment about saving ArrowBlocks 5e4711a <Bryan Cutler> Moved lists of ArrowBlocks in ArrowWriter base class to ArrowFileWriter where they are used
ArrowStreamWriter inherits from ArrowWriter the behavior of accumulating an ArrowBlock for each ArrowRecordBatch that is written. But this data is never used in the context of ArrowStreamWriter. writeRecordBatch can be overridden in ArrowStreamWriter to avoid adding the memory overhead.