minor fixes

This commit is contained in:
Anton Popov 2022-03-14 17:29:18 +00:00
parent 36ec379aeb
commit 063917786e
6 changed files with 16 additions and 12 deletions

View File

@ -676,6 +676,10 @@ void ColumnObject::addSubcolumn(const PathInData & key, MutableColumnPtr && subc
if (num_rows == 0)
num_rows = new_size;
else if (new_size != num_rows)
throw Exception(ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH,
"Size of subcolumn {} ({}) is inconsistent with column size ({})",
key.getPath(), new_size, num_rows);
}
void ColumnObject::addSubcolumn(const PathInData & key, size_t new_size)
@ -686,6 +690,10 @@ void ColumnObject::addSubcolumn(const PathInData & key, size_t new_size)
if (num_rows == 0)
num_rows = new_size;
else if (new_size != num_rows)
throw Exception(ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH,
"Requiered size of subcolumn {} ({}) is inconsistent with column size ({})",
key.getPath(), new_size, num_rows);
}
void ColumnObject::addNestedSubcolumn(const PathInData & key, const FieldInfo & field_info, size_t new_size)

View File

@ -15,13 +15,12 @@ ColumnPtr tryGetColumnFromBlock(const Block & block, const NameAndTypePair & req
if (!elem)
return nullptr;
auto subcolumn_name = requested_column.getSubcolumnName();
DataTypePtr elem_type;
ColumnPtr elem_column;
if (requested_column.isSubcolumn())
{
auto subcolumn_name = requested_column.getSubcolumnName();
elem_type = elem->type->tryGetSubcolumnType(subcolumn_name);
elem_column = elem->type->tryGetSubcolumn(subcolumn_name, elem->column);

View File

@ -423,7 +423,8 @@ public:
bool mayBenefitFromIndexForIn(const ASTPtr & left_in_operand, ContextPtr, const StorageMetadataPtr & metadata_snapshot) const override;
/// Snapshot for MergeTree fixes the current set of data parts.
/// Snapshot for MergeTree contains the current set of data parts
/// at the moment of the start of query.
struct SnapshotData : public StorageSnapshot::Data
{
DataPartsVector parts;

View File

@ -61,8 +61,9 @@ public:
bool isRemote() const override { return true; }
/// Snapshot for StorageDistributed fixes current descriptions
/// of columns of type Object for each shard.
/// Snapshot for StorageDistributed contains descriptions
/// of columns of type Object for each shard at the moment
/// of the start of query.
struct SnapshotData : public StorageSnapshot::Data
{
ColumnsDescriptionByShardNum objects_by_shard;

View File

@ -29,7 +29,8 @@ public:
size_t getSize() const { return data.get()->size(); }
/// Snapshot for StorageMemory fixes current set of blocks.
/// Snapshot for StorageMemory contains current set of blocks
/// at the moment of the start of query.
struct SnapshotData : public StorageSnapshot::Data
{
std::shared_ptr<const Blocks> blocks;

View File

@ -124,13 +124,7 @@ Block StorageSnapshot::getSampleBlockForColumns(const Names & column_names) cons
namespace
{
#if !defined(ARCADIA_BUILD)
using DenseHashSet = google::dense_hash_set<StringRef, StringRefHash>;
#else
using DenseHashSet = google::sparsehash::dense_hash_set<StringRef, StringRefHash>;
#endif
}
void StorageSnapshot::check(const Names & column_names) const