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); }