-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fix Compression file check output error messages #12009
Conversation
✅ Deploy Preview for meta-velox canceled.
|
52eb691
to
b63b301
Compare
f95ea89
to
b4a6a93
Compare
@ethanyzhang imported this issue into IBM GitHub Enterprise |
b4a6a93
to
0ad778b
Compare
"{} decompression failed, input len is too small: {}", | ||
kind_, | ||
compressedSize); | ||
fmt::format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: plz add fmt
header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added in thank you!
0ad778b
to
b962a67
Compare
compressedSize); | ||
fmt::format( | ||
"{} decompression failed, input len is too small: {}", | ||
kind_, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace all occurrences of kind_
w/ ::facebook::velox::common::compressionKindToString(kind_)
, instead of kind_
6b07bfa
to
11f2585
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jkhaliqi
"{} decompression failed, input len is too small: {}", | ||
::facebook::velox::common::compressionKindToString(kind_), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CompressionKind has an fmt formatter. Can we skip this function call?
struct fmt::formatter<facebook::velox::common::CompressionKind> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the find @majetideepak! @zuyu Looks like function call can be skipped so made all occurrences switch to just kind_
.
11f2585
to
969bb53
Compare
19bd93f
to
fa1b902
Compare
@xiaoxmeng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
kind_, | ||
remainingOutputSize, | ||
decompressedBlockSize); | ||
fmt::format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internally someone pointed out that DWIO_ENSURE_GE eventually uses folly::toString which concatenates consecutive strings. So it should be used kind of like using std::count. so the right way would be:
DWIO_ENSURE_GE(
remainingOutputSize,
decompressedBlockSize,
::facebook::velox::common::compressionKindToString(kind_),
" decompression failed, remainingOutputSize is less than "
"decompressedBlockSize, remainingOutputSize: ",
remainingOutputSize,
", decompressedBlockSize: ",
decompressedBlockSize);
which is translated to:
({
auto const& _tmp = (remainingOutputSize >= decompressedBlockSize);
_tmp ? _tmp
: throw facebook::velox::dwio::common::exception::LoggedException(
"_file_name_",
266,
"_function_name_",
"remainingOutputSize >= decompressedBlockSize",
::folly::to<std::string>(
"[Range Constraint Violation : ",
remainingOutputSize,
">=",
decompressedBlockSize,
"] : ",
::facebook::velox::common::compressionKindToString(kind_),
" decompression failed, remainingOutputSize is less than "
"decompressedBlockSize, remainingOutputSize: ",
remainingOutputSize,
", decompressedBlockSize: ",
decompressedBlockSize),
::facebook::velox::error_source::kErrorSourceRuntime,
::facebook::velox::error_code::kUnknown);
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bikramSingh91 Thanks for letting me know, seems to work as expected with these changes! Updated the code accordingly!
00b551e
to
67ec72d
Compare
67ec72d
to
c8919a6
Compare
@bikramSingh91 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@bikramSingh91 merged this pull request in 4bd1221. |
…tor#12009) Summary: fixes: facebookincubator#11657 Pull Request resolved: facebookincubator#12009 Reviewed By: xiaoxmeng Differential Revision: D68781620 Pulled By: bikramSingh91 fbshipit-source-id: 4ccd11a4f6fa94bffea3498b55af378abccd656a
fixes: #11657