This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new 63cd5270cfd branch-3.1: [refactor](compress) Unify the decompressin
error msg #56299 (#56479)
63cd5270cfd is described below
commit 63cd5270cfd254c6f02bc57ed0dfd1e863632d60
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Sep 29 18:02:52 2025 +0800
branch-3.1: [refactor](compress) Unify the decompressin error msg #56299
(#56479)
Cherry-picked from #56299
Co-authored-by: Refrain <[email protected]>
---
be/src/exec/decompressor.cpp | 36 ++++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 14 deletions(-)
diff --git a/be/src/exec/decompressor.cpp b/be/src/exec/decompressor.cpp
index 5da2e6acbb9..fd1bdbfad4c 100644
--- a/be/src/exec/decompressor.cpp
+++ b/be/src/exec/decompressor.cpp
@@ -176,7 +176,7 @@ Status GzipDecompressor::init() {
int window_bits = _is_deflate ? WINDOW_BITS : (WINDOW_BITS | DETECT_CODEC);
int ret = inflateInit2(&_z_strm, window_bits);
if (ret < 0) {
- return Status::InternalError("Failed to init inflate. status code:
{}", ret);
+ return Status::InternalError("Failed to do gzip decompress. status
code: {}", ret);
}
return Status::OK();
@@ -220,10 +220,21 @@ Status GzipDecompressor::decompress(uint8_t* input,
size_t input_len, size_t* in
// reset _z_strm to continue decoding a subsequent gzip stream
ret = inflateReset(&_z_strm);
if (ret != Z_OK) {
- return Status::InternalError("Failed to inflateReset. return
code: {}", ret);
+ if (_is_deflate) {
+ return Status::InternalError("Failed to do deflate
decompress. return code: {}",
+ ret);
+ } else {
+ return Status::InternalError("Failed to do gzip
decompress. return code: {}",
+ ret);
+ }
}
} else if (ret != Z_OK) {
- return Status::InternalError("Failed to inflate. return code: {}",
ret);
+ if (_is_deflate) {
+ return Status::InternalError("Failed to do deflate decompress.
return code: {}",
+ ret);
+ } else {
+ return Status::InternalError("Failed to do gzip decompress.
return code: {}", ret);
+ }
} else {
// here ret must be Z_OK.
// we continue if avail_out and avail_in > 0.
@@ -250,7 +261,7 @@ Status Bzip2Decompressor::init() {
bzero(&_bz_strm, sizeof(_bz_strm));
int ret = BZ2_bzDecompressInit(&_bz_strm, 0, 0);
if (ret != BZ_OK) {
- return Status::InternalError("Failed to init bz2. status code: {}",
ret);
+ return Status::InternalError("Failed to do bz2 decompress. status
code: {}", ret);
}
return Status::OK();
@@ -276,19 +287,17 @@ Status Bzip2Decompressor::decompress(uint8_t* input,
size_t input_len, size_t* i
if (ret == BZ_DATA_ERROR || ret == BZ_DATA_ERROR_MAGIC) {
LOG(INFO) << "input_bytes_read: " << *input_bytes_read
<< " decompressed_len: " << *decompressed_len;
- return Status::InternalError("Failed to bz2 decompress. status
code: {}", ret);
+ return Status::InternalError("Failed to do bz2 decompress. status
code: {}", ret);
} else if (ret == BZ_STREAM_END) {
*stream_end = true;
ret = BZ2_bzDecompressEnd(&_bz_strm);
if (ret != BZ_OK) {
- return Status::InternalError(
- "Failed to end bz2 after meet BZ_STREAM_END. status
code: {}", ret);
+ return Status::InternalError("Failed to do bz2 decompress.
status code: {}", ret);
}
ret = BZ2_bzDecompressInit(&_bz_strm, 0, 0);
if (ret != BZ_OK) {
- return Status::InternalError(
- "Failed to init bz2 after meet BZ_STREAM_END. status
code: {}", ret);
+ return Status::InternalError("Failed to do bz2 decompress.
status code: {}", ret);
}
} else if (ret != BZ_OK) {
return Status::InternalError("Failed to bz2 decompress. status
code: {}", ret);
@@ -337,7 +346,7 @@ Status ZstdDecompressor::decompress(uint8_t* input, size_t
input_len, size_t* in
*decompressed_len = outputBuffer.pos;
if (ZSTD_isError(ret)) {
- return Status::InternalError("Failed to zstd decompress: {}",
ZSTD_getErrorName(ret));
+ return Status::InternalError("Failed to do zstd decompress: {}",
ZSTD_getErrorName(ret));
}
*stream_end = ret == 0;
@@ -546,7 +555,7 @@ Status Lz4BlockDecompressor::decompress(uint8_t* input,
size_t input_len, size_t
reinterpret_cast<const char*>(input_ptr),
reinterpret_cast<char*>(output_ptr),
compressed_small_block_len, remaining_output_len);
if (decompressed_small_block_len < 0) {
- return Status::InvalidArgument("fail to do LZ4 decompress,
error = {}",
+ return Status::InvalidArgument("Failed to do Lz4Block
decompress, error = {}",
LZ4F_getErrorName(decompressed_small_block_len));
}
input_ptr += compressed_small_block_len;
@@ -663,14 +672,13 @@ Status SnappyBlockDecompressor::decompress(uint8_t*
input, size_t input_len,
if (!snappy::GetUncompressedLength(reinterpret_cast<const
char*>(input_ptr),
compressed_small_block_len,
&decompressed_small_block_len))
{
- return Status::InternalError(
- "snappy block decompress failed to get uncompressed
len");
+ return Status::InternalError("Failed to do snappy
decompress.");
}
if (!snappy::RawUncompress(reinterpret_cast<const
char*>(input_ptr),
compressed_small_block_len,
reinterpret_cast<char*>(output_ptr))) {
return Status::InternalError(
- "snappy block decompress failed. uncompressed_len: {},
compressed_len: {}",
+ "Failed to do snappy decompress. uncompressed_len: {},
compressed_len: {}",
decompressed_small_block_len,
compressed_small_block_len);
}
input_ptr += compressed_small_block_len;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]