You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "opwvhk (via GitHub)" <gi...@apache.org> on 2025/02/21 10:45:23 UTC

Re: [PR] AVRO-3590: Fix Snappy CodecFactory is null [avro]

opwvhk commented on code in PR #1790:
URL: https://github.com/apache/avro/pull/1790#discussion_r1965269865


##########
lang/java/avro/src/main/java/org/apache/avro/file/CodecFactory.java:
##########
@@ -66,7 +66,7 @@ public static CodecFactory xzCodec(int compressionLevel) {
   /** Snappy codec. */
   public static CodecFactory snappyCodec() {
     try {
-      return new SnappyCodec.Option();
+      return SnappyCodec.OPTION;
     } catch (Throwable t) {
       LOG.debug("Snappy was not available", t);
       return null;

Review Comment:
   In the new situation, the `SnappyCodec.OPTION` has already been created, so the try-catch block is now misplaced. Worse, Avro will fail to initialise when Snappy is not available.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org