问题
Firehose is pushing data to s3 in snappy compressed form and its framing format is hadoop compatible. I am downloading that snappy file and trying to uncompress in scala using this library.
val input: Array[Byte] = Files.readAllBytes(Paths.get("/path/to/prod-a8d272bb-b7af-4141-bdba-6965b343a75f.snappy"))
val uncompressed: Array[Byte] = Snappy.uncompress(input)
Which throws error
Exception in thread "main" java.io.IOException: FAILED_TO_UNCOMPRESS(5)
at org.xerial.snappy.SnappyNative.throw_error(SnappyNative.java:98)
It is possible to generate Hadoop Snappy compatible compressed stream using SnappyHadoopCompatibleOutputStream, but in my case, I need to uncompress an already generated compressed file. Is it possible with this library ? or if not, is there any other library I could use ?
来源:https://stackoverflow.com/questions/59612261/uncompress-hadoop-compatible-snappy-file