Skip to content

Commit

Permalink
Add malformed partition component to the exception message
Browse files Browse the repository at this point in the history
Summary: Add the malformed partition component to the exception message to facilitate troubleshooting of errors like this https://fburl.com/scuba/xldb_koski_queries/52viv41r

Reviewed By: xiaoxmeng

Differential Revision: D67652803
  • Loading branch information
sdruzkin authored and facebook-github-bot committed Dec 26, 2024
1 parent 9e418b1 commit bbe7fbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion velox/dwio/catalog/fbhive/FileUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ std::string FileUtils::unescapePathName(const std::string& data) {
std::string tmp{data.data() + i + 1, HEX_WIDTH};
char* end;
c = static_cast<char>(std::strtol(tmp.c_str(), &end, 16));
DWIO_ENSURE(errno != ERANGE && end == tmp.data() + HEX_WIDTH);
DWIO_ENSURE(
errno != ERANGE && end == tmp.data() + HEX_WIDTH,
"Malformed path component: ",
data);
i += HEX_WIDTH;
}
ret.append(1, c);
Expand Down
3 changes: 3 additions & 0 deletions velox/dwio/catalog/fbhive/test/FileUtilsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ TEST(FileUtilsTests, MakePartName) {

TEST(FileUtilsTests, ParsePartKeyValues) {
ASSERT_THROW(FileUtils::parsePartKeyValues("ds"), LoggedException);
ASSERT_THROW(
FileUtils::parsePartKeyValues("ts=2025-01-01+00%3A00%ZZ99"),
LoggedException);

ASSERT_THAT(
FileUtils::parsePartKeyValues(
Expand Down

0 comments on commit bbe7fbd

Please sign in to comment.