[ 
https://issues.apache.org/jira/browse/PARQUET-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16420982#comment-16420982
 ] 

Ryan Blue commented on PARQUET-1184:
------------------------------------

The reason why this is an abstract class is so that you can use it to wrap 
implementations that provide a position, like Hadoop's FsOutputStream. It would 
not be correct to assume that the position is at the current number of bytes 
written to the underlying stream. An implementation could wrap RandomAccessFile 
and expose its seek method, which would invalidate the delegating stream's 
position.

The delegating class is present for convenience only. You don't have to use it 
and can implement your own logic as long as you implement PositionOutputStream.

> Make DelegatingPositionOutputStream a concrete class
> ----------------------------------------------------
>
>                 Key: PARQUET-1184
>                 URL: https://issues.apache.org/jira/browse/PARQUET-1184
>             Project: Parquet
>          Issue Type: Improvement
>          Components: parquet-avro
>    Affects Versions: 1.9.1
>            Reporter: Werner Daehn
>            Priority: Major
>             Fix For: 1.10.0
>
>
> I fail to understand why this is an abstract class. In my example I want to 
> write the Parquet file to a java.io.FileOutputStream, hence have to extend 
> the DelegatingPositionOutputStream and store the pos information, increase it 
> in all write(..) methods and return its value in getPos().
> Doable of course, but useful? Previously yes but now with the OutputFile 
> changes to decouple it from Hadoop more, I believe no.
> related to: https://issues.apache.org/jira/browse/PARQUET-1142



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to