Have you look at the Hadoop SequenceFile API  ?
http://hadoop.apache.org/docs/r2.6.0/api/org/apache/hadoop/io/SequenceFile.html

In particular SequenceFile.createWriter

It worked for me.

Here is also a sample from stack overflow
http://stackoverflow.com/a/25484581










On Mon, May 4, 2015 at 12:02 PM, Grant Overby (groverby) <[email protected]
> wrote:

>   I’m looking for some sample code to write a hive compatible sequence
> file for an external table and matching ddl.
>
>  I’m starting with a java pojo. I can create an Object Inspector for this
> class. I’m reasonably sure I can write a serde leveraging java’s
> externalizable serialization. I’m coming up a bit short on how to wire this
> together.
>
>  My end goal is to have this file query able while I’m writing to it. I
> don’t know if Hive will work this way out of the box. Perhaps I’ll need a
> modified InputFormat to skip over incomplete rows?
>
>         *Grant Overby*
> Software Engineer
> Cisco.com <http://www.cisco.com/>
> [email protected]
> Mobile: *865 724 4910 <865%20724%204910>*
>
>
>
>        Think before you print.
>
> This email may contain confidential and privileged material for the sole
> use of the intended recipient. Any review, use, distribution or disclosure
> by others is strictly prohibited. If you are not the intended recipient (or
> authorized to receive for the recipient), please contact the sender by
> reply email and delete all copies of this message.
>
> Please click here
> <http://www.cisco.com/web/about/doing_business/legal/cri/index.html> for
> Company Registration Information.
>
>
>
>

Reply via email to