gfphoenix78 commented on code in PR #1344:
URL: https://github.com/apache/cloudberry/pull/1344#discussion_r2320663692


##########
contrib/pax_storage/src/cpp/storage/columns/pax_compress.cc:
##########
@@ -230,9 +234,14 @@ size_t PaxLZ4Compressor::GetCompressBound(size_t src_len) {
 }
 
 size_t PaxLZ4Compressor::Compress(void *dst_buff, size_t dst_cap,
-                                  void *src_buff, size_t src_len, int /*lvl*/) 
{
-  return LZ4_compress_default((char *)src_buff, (char *)dst_buff, src_len,
-                              dst_cap);
+                                  void *src_buff, size_t src_len, int lvl) {
+#define LZ4_MAX_ACC 65536
+  // acceleration is oppsite meaning of compress level
+  // map [19, 0] to [0, LZ4_MAX_ACC]
+  int acceleration = 19 - lvl;
+  acceleration = (int)(acceleration * LZ4_MAX_ACC / 20.0);

Review Comment:
   Thanks for your review. The `acceleration` is restricted to a small range.



-- 
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: commits-unsubscr...@cloudberry.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org
For additional commands, e-mail: commits-h...@cloudberry.apache.org

Reply via email to