[
https://issues.apache.org/jira/browse/AVRO-1726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14730989#comment-14730989
]
Sean Busbey commented on AVRO-1726:
-----------------------------------
{code}
+ /**
+ * Appends blocks from another file. otherFile must have the same schema.
* Data blocks will be copied without de-serializing data. If the codecs
* of the two files are compatible, data blocks are copied directly without
* decompression. If the codecs are not compatible, blocks from otherFile
@@ -354,11 +365,13 @@
* deflate at compression level 7. If <i>recompress</i> is false, blocks
* will be copied without changing the compression level. If true, they will
* be converted to the new compression level.
- * @param otherFile
- * @param recompress
+ * @param otherFile the file to append from
+ * @param recompress whether or not to recompress blocks as they are appended
+ * @param numBlocks the number of blocks to append
+ * @return true if otherFile has more blocks available, false otherwise
* @throws IOException
*/
- public void appendAllFrom(DataFileStream<D> otherFile, boolean recompress)
throws IOException {
+ public boolean appendBlocksFrom(DataFileStream<D> otherFile, boolean
recompress, long numBlocks) throws IOException {
{code}
Is it worth adding a block-number-offset so that the method can be used to
handle arbitrary "pull a contiguous sub-set of blocks"?
> Add support for appending a variable number of blocks to DataFileWriter
> -----------------------------------------------------------------------
>
> Key: AVRO-1726
> URL: https://issues.apache.org/jira/browse/AVRO-1726
> Project: Avro
> Issue Type: Improvement
> Affects Versions: 1.7.7
> Reporter: Bryan Bende
> Priority: Minor
> Fix For: 1.7.8, 1.8.0
>
> Attachments: AVRO-1726.patch
>
>
> It would be helpful to have the ability to append a variable number of raw
> blocks from a DataFileReader to a DataFileWriter, similar to appendAllFrom()
> but specifying how many blocks to append.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)