Slightly better diagnostics

This commit is contained in:
Alexey Milovidov 2023-06-17 17:20:44 +02:00
parent 61e423c5df
commit c7a18c640e
2 changed files with 18 additions and 5 deletions

View File

@ -79,7 +79,11 @@ void IMergeTreeReader::fillMissingColumns(Columns & res_columns, bool & should_e
catch (Exception & e)
{
/// Better diagnostics.
e.addMessage("(while reading from part " + data_part_info_for_read->getDataPartStorage()->getFullPath() + ")");
const auto & part_storage = data_part_info_for_read->getDataPartStorage();
e.addMessage(
"(while reading from part " + part_storage->getFullPath()
+ " located on disk " + part_storage->getDiskName()
+ " of type " + part_storage->getDiskType() + ")");
throw;
}
}
@ -124,7 +128,11 @@ void IMergeTreeReader::evaluateMissingDefaults(Block additional_columns, Columns
catch (Exception & e)
{
/// Better diagnostics.
e.addMessage("(while reading from part " + data_part_info_for_read->getDataPartStorage()->getFullPath() + ")");
const auto & part_storage = data_part_info_for_read->getDataPartStorage();
e.addMessage(
"(while reading from part " + part_storage->getFullPath()
+ " located on disk " + part_storage->getDiskName()
+ " of type " + part_storage->getDiskType() + ")");
throw;
}
}
@ -199,7 +207,11 @@ void IMergeTreeReader::performRequiredConversions(Columns & res_columns) const
catch (Exception & e)
{
/// Better diagnostics.
e.addMessage("(while reading from part " + data_part_info_for_read->getDataPartStorage()->getFullPath() + ")");
const auto & part_storage = data_part_info_for_read->getDataPartStorage();
e.addMessage(
"(while reading from part " + part_storage->getFullPath()
+ " located on disk " + part_storage->getDiskName()
+ " of type " + part_storage->getDiskType() + ")");
throw;
}
}

View File

@ -188,10 +188,11 @@ size_t MergeTreeReaderWide::readRows(
data_part_info_for_read->reportBroken();
/// Better diagnostics.
const auto & part_storage = data_part_info_for_read->getDataPartStorage();
e.addMessage(
fmt::format(
"(while reading from part {} from mark {} with max_rows_to_read = {})",
data_part_info_for_read->getDataPartStorage()->getFullPath(),
"(while reading from part {} located on disk {} of type {}, from mark {} with max_rows_to_read = {})",
part_storage->getFullPath(), part_storage->getDiskName(), part_storage->getDiskType(),
toString(from_mark), toString(max_rows_to_read)));
throw;
}