admin管理员组

文章数量:1392101

I have customer-supplied .avro files that use snappy compression, and I currently only have the avro-tools 1.11.3 jar file. When I try to do pretty much anything with these files, I get the following error:

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform...using builtin-java classes where applicable
Exception in thread "main" .apache.avro.AvroRuntimeException: Unrecognized codec: snappy
    at .apache.avro.file.CodecFactory.fromString(CodecFactory.java:159)
    at .apache.avro.file.DataFileStream.resolveCodec(DataFileStream.java:158)
    at .apache.avro.file.DataFileStream.initialize(DataFileStream.java:144)
    at .apache.avro.file.DataFileStream.<init>(DataFileStream.java:90)
    at .apache.avro.tool.DataFileReadTool.run(DataFileReadTool.java:93)
    at .apache.avro.tool.Main.run(Main.java:67)
    at .apache.avro.tool.Main.main(Main.java:56)

Note I do not have access to the internet on the system in question and I don't have admin access, so I'd like to make sure my request is correct and complete. I'm just looking to convert the data to JSON or text for now.

Thank you!

EDIT:

Okay, I am officially lost. I unzipped the avro-tools jar file and found that snappy-java is already there! There's even a class called SnappyCodec.class in /xerial/snappy, so I assume this is supposed to work out of the box.

I'm running OpenJDK 1.8.0_442, any chance that's an issue? The only other thing I can think of is some kind of security setting interfering with the process. I've had SELinux and FIPS mode issues bite me before, but as a non-admin I don't have any visibility into those. I'd appreciate any insight and things to try/check.

Thanks again!

本文标签: javaWhy does my avrotoolsjar not recognize snappycompressed avro filesStack Overflow