hadoop - How to read Snappy Compressed file from S3 in Java -


currently running mapreduce job in hadoop in output compressed snappycompression. moving output file s3. want read compressed file s3 through java.

i found answer read snappy compressed file s3. first should object content s3. , decompress file.

    s3object s3object = s3client.getobject(new getobjectrequest(bucketname,path));     inputstream incontent = s3object.getobjectcontent();     compressioncodec codec = (compressioncodec) reflectionutils.newinstance(snappycodec.class, new configuration());     inputstream instream = codec.createinputstream(new bufferedinputstream(incontent));     inputstreamreader  inread = new inputstreamreader(instream);     bufferedreader br = new bufferedreader(inread);     string line=null;     while ((line = br.readline()) != null){         system.out.println(line);     }    

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -