imay commented on a change in pull request #1646: Support page compression in 

 File path: be/src/olap/rowset/segment_v2/page_compression.cpp
 @@ -0,0 +1,88 @@
+// 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
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+#include "olap/rowset/segment_v2/page_compression.h"
+#include "gutil/strings/substitute.h"
+#include "util/block_compression.h"
+#include "util/coding.h"
+namespace doris {
+namespace segment_v2 {
+using strings::Substitute;
+Status PageDecompressor::init() {
+    if (_data.size < 4) {
+        return Status::Corruption(
+            Substitute("Compressed page's size is too small, size=$0, 
+                       _data.size, 4));
+    }
+    _uncompressed_bytes = decode_fixed32_le((uint8_t*);
+    return Status::OK();
+Status PageDecompressor::decompress_to(void* buf) {
+    Slice compressed_slice( + 4, _data.size - 4);
+    if (compressed_slice.size == _uncompressed_bytes) {
+        // If compressed_slice's size is equal with _uncompressed_bytes, it 
+        // compressor store this directly without compression. So we just copy
+        // this to buf and return.
+        memcpy(buf,, _uncompressed_bytes);
 Review comment:
   It will be a little tricky. And I will make it TODO

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.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to