You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "yaooqinn (via GitHub)" <gi...@apache.org> on 2024/01/24 10:04:15 UTC

[PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

yaooqinn opened a new pull request, #2707:
URL: https://github.com/apache/avro/pull/2707

   <!--
   
   *Thank you very much for contributing to Apache Avro - we are happy that you want to help us improve Avro. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Avro a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/AVRO/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "AVRO-XXXX: [component] Title of the pull request", where *AVRO-XXXX* should be replaced by the actual issue number. 
       The *component* is optional, but can help identify the correct reviewers faster: either the language ("java", "python") or subsystem such as "build" or "doc" are good candidates.  
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests. You can [build the entire project](https://github.com/apache/avro/blob/main/BUILD.md) or just the [language-specific SDK](https://avro.apache.org/project/how-to-contribute/#unit-tests).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Every commit message references Jira issues in their subject lines. In addition, commits follow the guidelines from [How to write a good git commit message](https://chris.beams.io/posts/git-commit/)
       1. Subject is separated from body by a blank line
       1. Subject is limited to 50 characters (not including Jira issue reference)
       1. Subject does not end with a period
       1. Subject uses the imperative mood ("add", not "adding")
       1. Body wraps at 72 characters
       1. Body explains "what" and "why", not "how"
   
   -->
   
   ## What is the purpose of the change
   
   Mapping org.apache.hadoop.io.ZStandardCodec to zstandard in 
   HadoopCodecFactory
   
   
   ## Verifying this change
   
   
   This change added tests 
   
   ## Documentation
   
   - Does this pull request introduce a new feature? (yes)
   - If yes, how is the feature documented? (JavaDocs)
   


-- 
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: dev-unsubscribe@avro.apache.org

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


Re: [PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on PR #2707:
URL: https://github.com/apache/avro/pull/2707#issuecomment-1911553261

   @yaooqinn I'll leave it to the Java SDK maintainers to review and merge.


-- 
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


Re: [PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

Posted by "KalleOlaviNiemitalo (via GitHub)" <gi...@apache.org>.
KalleOlaviNiemitalo commented on PR #2707:
URL: https://github.com/apache/avro/pull/2707#issuecomment-1908166072

   @martin-g, what's the test in which `CodecFactory.fromString("deflate")` returns `GZipCodec.class`?  To me, it looks like there is no `GZipCodec` class, and `HadoopCodecFactory` uses the `DeflateCodec` class for both "org.apache.hadoop.io.compress.DeflateCodec" and "org.apache.hadoop.io.compress.GZipCodec", whereas `CodecFactory` doesn't have this kind of aliasing built-in.


-- 
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


Re: [PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #2707:
URL: https://github.com/apache/avro/pull/2707#issuecomment-1911571479

   OK. I got it. Thank you @martin-g 


-- 
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


Re: [PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on PR #2707:
URL: https://github.com/apache/avro/pull/2707#issuecomment-1908181073

   @KalleOlaviNiemitalo I meant these two tests:
   - https://github.com/apache/avro/blob/61fd3e4c245409e60a57c45494ca461f56a834e3/lang/java/mapred/src/test/java/org/apache/avro/hadoop/file/TestHadoopCodecFactory.java#L29
   - https://github.com/apache/avro/blob/61fd3e4c245409e60a57c45494ca461f56a834e3/lang/java/mapred/src/test/java/org/apache/avro/hadoop/file/TestHadoopCodecFactory.java#L50
   
   I didn't fire an IDE to debug what is going on. It seems one is an alias to the other...


-- 
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


Re: [PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

Posted by "KalleOlaviNiemitalo (via GitHub)" <gi...@apache.org>.
KalleOlaviNiemitalo commented on PR #2707:
URL: https://github.com/apache/avro/pull/2707#issuecomment-1908222574

   Oh and Hadoop spells "GzipCodec" with a lowercase "z", but `HadoopCodecFactory` in Avro registers "GZipCodec" with an uppercase "Z".  Perhaps it is already not interoperable, then.


-- 
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


Re: [PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #2707:
URL: https://github.com/apache/avro/pull/2707#issuecomment-1911294956

   Hi, @martin-g @KalleOlaviNiemitalo. Do we have any comment I missed to address for this PR?


-- 
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


Re: [PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

Posted by "KalleOlaviNiemitalo (via GitHub)" <gi...@apache.org>.
KalleOlaviNiemitalo commented on PR #2707:
URL: https://github.com/apache/avro/pull/2707#issuecomment-1908215928

   The `compress` method in org.apache.avro.file.DeflateCodec calls `getDeflater`, which then passes the `nowrap` flag to `java.util.zip.Deflater`, and the value of `nowrap` is always `true`, so it will omit the GZip header.  It seems wrong to me that "org.apache.hadoop.io.compress.GZipCodec" is mapped to that implementation, especially as [GZipCodec in Hadoop](https://github.com/apache/hadoop/blob/af5c8e70ea4bab2339cfae2dcccfbb211c74417f/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/GzipCodec.java) uses `ZlibCompressor.CompressionHeader.GZIP_FORMAT`.  OTOH, GZipCodec in Hadoop apparently supports both formats when decompressing, so the mismatch is perhaps not causing problems in practice.


-- 
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


Re: [PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on PR #2707:
URL: https://github.com/apache/avro/pull/2707#issuecomment-1909440212

   In a separate JIRA+PR. Thank you!


-- 
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


Re: [PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #2707:
URL: https://github.com/apache/avro/pull/2707#issuecomment-1909413781

   Thanks for the review, @martin-g, and @KalleOlaviNiemitalo. 
   
   Shall I fix the GzipCodec issue here? Or with a follow-up, as it seems orthogonal?


-- 
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


Re: [PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on PR #2707:
URL: https://github.com/apache/avro/pull/2707#issuecomment-1907995577

   Not related to this PR but I wonder how `CodecFactory.fromString("deflate");` works ?! 
   In one of the tests it returns `DeflateCodec.class`, while in another it returns `GzipCodec.class`


-- 
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


Re: [PR] AVRO-3930: Mapping org.apache.hadoop.io.ZStandardCodec to zstandard [avro]

Posted by "nielsbasjes (via GitHub)" <gi...@apache.org>.
nielsbasjes merged PR #2707:
URL: https://github.com/apache/avro/pull/2707


-- 
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: dev-unsubscribe@avro.apache.org

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