hudi-agent commented on code in PR #19917:
URL: https://github.com/apache/hudi/pull/19917#discussion_r3994542621


##########
hudi-io/src/main/java/org/apache/hudi/io/compress/airlift/HoodieAirliftSnappyCompressor.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hudi.io.compress.airlift;
+
+import org.apache.hudi.io.compress.CompressionCodec;
+import org.apache.hudi.io.compress.HoodieCompressor;
+
+import io.airlift.compress.hadoop.HadoopInputStream;
+import io.airlift.compress.hadoop.HadoopOutputStream;
+import io.airlift.compress.snappy.SnappyHadoopStreams;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+
+import static org.apache.hudi.io.util.IOUtils.readFully;
+
+/**
+ * Implementation of {@link HoodieCompressor} for {@link 
CompressionCodec#SNAPPY} compression
+ * codec using airlift aircompressor's Snappy compressor and decompressor.
+ */
+public class HoodieAirliftSnappyCompressor implements HoodieCompressor {
+  private final SnappyHadoopStreams snappyStreams;
+
+  public HoodieAirliftSnappyCompressor() {
+    snappyStreams = new SnappyHadoopStreams();
+  }
+
+  @Override
+  public int decompress(InputStream compressedInput,

Review Comment:
   🤖 The tests here only round-trip Hudi writer -> Hudi reader. Since HFile 
SNAPPY blocks written by HBase use the Hadoop `BlockCompressorStream` framing, 
would it be worth adding an HBase-generated SNAPPY fixture under 
`hudi-io/src/test/resources/hfile/` (like the existing `*_GZ_*` ones) to 
confirm `SnappyHadoopStreams` reads them and that files we write are readable 
by the HBase reader?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to