Skip to content

Commit

Permalink
[enhancement](compression) prints the specific exception when ZSTD co…
Browse files Browse the repository at this point in the history
…mpress fails (#39433)
  • Loading branch information
luwei16 authored Aug 20, 2024
1 parent 0c855e9 commit eb5cd76
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions be/src/util/block_compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <gen_cpp/parquet_types.h>
#include <gen_cpp/segment_v2.pb.h>
#include <glog/logging.h>

#include <exception>
// Only used on x86 or x86_64
#if defined(__x86_64__) || defined(_M_X64) || defined(i386) || defined(__i386__) || \
defined(__i386) || defined(_M_IX86)
Expand Down Expand Up @@ -951,6 +953,8 @@ class ZstdBlockCompression : public BlockCompressionCodec {
if (max_len <= MAX_COMPRESSION_BUFFER_SIZE_FOR_REUSE) {
output->assign_copy(reinterpret_cast<uint8_t*>(compressed_buf.data), out_buf.pos);
}
} catch (std::exception e) {
return Status::InternalError("Fail to do ZSTD compress due to exception {}", e.what());
} catch (...) {
// Do not set compress_failed to release context
DCHECK(!compress_failed);
Expand Down

0 comments on commit eb5cd76

Please sign in to comment.