try again the if value.empty() in the beginning.

Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
This commit is contained in:
Jianfei Hu 2023-08-14 22:25:47 +00:00
parent 49502ac0ce
commit 1e600351d9

View File

@ -371,6 +371,11 @@ void MergeTreePartition::serializeText(const MergeTreeData & storage, WriteBuffe
const auto & partition_key_sample = metadata_snapshot->getPartitionKey().sample_block;
size_t key_size = partition_key_sample.columns();
if (value.empty())
{
writeCString("tuple()", out);
return;
}
if (key_size == 0)
{
writeCString("tuple()", out);
@ -386,10 +391,10 @@ void MergeTreePartition::serializeText(const MergeTreeData & storage, WriteBuffe
// {
// LOG_INFO(&Poco::Logger::get("DNSCacheUpdater"), "jianfeih debug type is not nil, name {}.", type->getName());
// }
if (value.empty())
{
// if (value.empty())
// {
// LOG_INFO(&Poco::Logger::get("DNSCacheUpdater"), "jianfeih debug: find the root cause, value is empty");
writeCString("tuple()", out);
// writeCString("tuple()", out);
// LOG_INFO(
// &Poco::Logger::get("DNSCacheUpdater"),
// "jianfeih debug: type is nil: {}, colum is nil: {}, storage has partition key: {}, column size: {}, "
@ -399,10 +404,10 @@ void MergeTreePartition::serializeText(const MergeTreeData & storage, WriteBuffe
// metadata_snapshot->hasPartitionKey(),
// metadata_snapshot->columns.size(),
// all_column_names.toString());
return;
}
else
{
// return;
// }
// else
// {
// LOG_INFO(&Poco::Logger::get("DNSCacheUpdater"), "jianfeih debug: value[0] to be inserted: {}", value[0]);
// should be here causing the segfault. column might be empty. some type created column is not okay.
// let's check the table definition; type; parts info at this point.
@ -410,7 +415,7 @@ void MergeTreePartition::serializeText(const MergeTreeData & storage, WriteBuffe
column->insert(value[0]);
type->getDefaultSerialization()->serializeText(*column, 0, out, format_settings);
// LOG_INFO(&Poco::Logger::get("DNSCacheUpdater"), "jianfeih debug: finish the serialization no error.");
}
// }
}
else
{