mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 13:42:02 +00:00
fix alters of nested
This commit is contained in:
parent
a42b00c9aa
commit
31e6956ac8
@ -48,19 +48,6 @@ String IDataType::Substream::toString() const
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
size_t IDataType::SubstreamPath::getHash() const
|
||||
{
|
||||
SipHash hash;
|
||||
for (const auto & elem : *this)
|
||||
{
|
||||
hash.update(elem.type);
|
||||
hash.update(elem.tuple_element_name);
|
||||
hash.update(elem.escape_tuple_delimiter);
|
||||
}
|
||||
|
||||
return hash.get64();
|
||||
}
|
||||
|
||||
String IDataType::SubstreamPath::toString() const
|
||||
{
|
||||
WriteBufferFromOwnString wb;
|
||||
|
@ -112,7 +112,6 @@ public:
|
||||
|
||||
struct SubstreamPath : public std::vector<Substream>
|
||||
{
|
||||
UInt64 getHash() const;
|
||||
String toString() const;
|
||||
};
|
||||
|
||||
|
@ -42,7 +42,14 @@ IMergeTreeReader::IMergeTreeReader(
|
||||
, all_mark_ranges(all_mark_ranges_)
|
||||
, alter_conversions(storage.getAlterConversionsForPart(data_part))
|
||||
{
|
||||
for (const NameAndTypePair & column_from_part : data_part->getColumns())
|
||||
auto part_columns = data_part->getColumns();
|
||||
if (settings.convert_nested_to_subcolumns)
|
||||
{
|
||||
columns = Nested::convertToSubcolumns(columns);
|
||||
part_columns = Nested::collect(part_columns);
|
||||
}
|
||||
|
||||
for (const NameAndTypePair & column_from_part : part_columns)
|
||||
columns_from_part[column_from_part.name] = column_from_part.type;
|
||||
}
|
||||
|
||||
|
@ -48,9 +48,12 @@ IMergeTreeDataPart::MergeTreeReaderPtr MergeTreeDataPartWide::getReader(
|
||||
const ValueSizeMap & avg_value_size_hints,
|
||||
const ReadBufferFromFileBase::ProfileCallback & profile_callback) const
|
||||
{
|
||||
auto new_settings = reader_settings;
|
||||
new_settings.convert_nested_to_subcolumns = true;
|
||||
|
||||
auto ptr = std::static_pointer_cast<const MergeTreeDataPartWide>(shared_from_this());
|
||||
return std::make_unique<MergeTreeReaderWide>(
|
||||
ptr, Nested::convertToSubcolumns(columns_to_read), metadata_snapshot, uncompressed_cache,
|
||||
ptr, columns_to_read, metadata_snapshot, uncompressed_cache,
|
||||
mark_cache, mark_ranges, reader_settings,
|
||||
avg_value_size_hints, profile_callback);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ struct MergeTreeReaderSettings
|
||||
/// If save_marks_in_cache is false, then, if marks are not in cache,
|
||||
/// we will load them but won't save in the cache, to avoid evicting other data.
|
||||
bool save_marks_in_cache = false;
|
||||
bool convert_nested_to_subcolumns = false;
|
||||
};
|
||||
|
||||
struct MergeTreeWriterSettings
|
||||
|
Loading…
Reference in New Issue
Block a user