Skip to content

Commit

Permalink
fix: Fix Compression file check output
Browse files Browse the repository at this point in the history
  • Loading branch information
jkhaliqi committed Jan 29, 2025
1 parent ce273fa commit 67ec72d
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions velox/dwio/common/compression/Compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ uint64_t LzoAndLz4DecompressorCommon::decompress(
DWIO_ENSURE_GE(
compressedSize,
dwio::common::INT_BYTE_SIZE,
"{} decompression failed, input len is too small: {}",
kind_,
::facebook::velox::common::compressionKindToString(kind_),
" decompression failed, input len is too small: ",
compressedSize);

uint32_t decompressedBlockSize =
Expand All @@ -258,11 +258,11 @@ uint64_t LzoAndLz4DecompressorCommon::decompress(
DWIO_ENSURE_GE(
remainingOutputSize,
decompressedBlockSize,
"{} decompression failed, remainingOutputSize is less than "
"decompressedBlockSize, remainingOutputSize: {}, "
"decompressedBlockSize: {}",
kind_,
::facebook::velox::common::compressionKindToString(kind_),
" decompression failed, remainingOutputSize is less than "
"decompressedBlockSize, remainingOutputSize: ",
remainingOutputSize,
", decompressedBlockSize: ",
decompressedBlockSize);

if (compressedSize <= 0) {
Expand All @@ -274,8 +274,8 @@ uint64_t LzoAndLz4DecompressorCommon::decompress(
DWIO_ENSURE_GE(
compressedSize,
dwio::common::INT_BYTE_SIZE,
"{} decompression failed, input len is too small: {}",
kind_,
::facebook::velox::common::compressionKindToString(kind_),
" decompression failed, input len is too small: ",
compressedSize);
// Read the length of the next lz4/lzo compressed block.
uint32_t compressedBlockSize =
Expand All @@ -286,14 +286,13 @@ uint64_t LzoAndLz4DecompressorCommon::decompress(
if (compressedBlockSize == 0) {
continue;
}

DWIO_ENSURE_LE(
compressedBlockSize,
compressedSize,
"{} decompression failed, compressedBlockSize is greater than compressedSize, "
"compressedBlockSize: {}, compressedSize: {}",
kind_,
::facebook::velox::common::compressionKindToString(kind_),
" decompression failed, compressedBlockSize is greater than compressedSize, compressedBlockSize: ",
compressedBlockSize,
", compressedSize: ",
compressedSize);

// Decompress this block.
Expand All @@ -307,10 +306,10 @@ uint64_t LzoAndLz4DecompressorCommon::decompress(
DWIO_ENSURE_LE(
decompressedSize,
remainingOutputSize,
"{} decompression failed, decompressedSize is not less than or equal to remainingOutputSize, "
"decompressedSize: {}, remainingOutputSize: {}",
::facebook::velox::common::compressionKindToString(kind_),
" decompression failed, decompressedSize is not less than or equal to remainingOutputSize, decompressedSize: ",
decompressedSize,
", remainingOutputSize: ",
remainingOutputSize);

outPtr += decompressedSize;
Expand All @@ -324,10 +323,10 @@ uint64_t LzoAndLz4DecompressorCommon::decompress(
DWIO_ENSURE_EQ(
decompressedTotalSize,
uncompressedSize,
"{} decompression failed, decompressedTotalSize is not equal to uncompressedSize, "
"decompressedTotalSize: {}, uncompressedSize: {}",
kind_,
::facebook::velox::common::compressionKindToString(kind_),
" decompression failed, decompressedTotalSize is not equal to uncompressedSize, decompressedTotalSize: ",
decompressedTotalSize,
", uncompressedSize: ",
uncompressedSize);

return decompressedTotalSize;
Expand Down

0 comments on commit 67ec72d

Please sign in to comment.