mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Review fixes
This commit is contained in:
parent
37691e573a
commit
3ac7f999bc
@ -159,7 +159,7 @@ DataTypes NamesAndTypesList::getTypes() const
|
||||
return res;
|
||||
}
|
||||
|
||||
void NamesAndTypesList::filterOut(const NameSet & names)
|
||||
void NamesAndTypesList::filterColumns(const NameSet & names)
|
||||
{
|
||||
for (auto it = begin(); it != end();)
|
||||
{
|
||||
|
@ -103,7 +103,7 @@ public:
|
||||
DataTypes getTypes() const;
|
||||
|
||||
/// Remove columns which names are not in the `names`.
|
||||
void filterOut(const NameSet & names);
|
||||
void filterColumns(const NameSet & names);
|
||||
|
||||
/// Leave only the columns whose names are in the `names`. In `names` there can be superfluous columns.
|
||||
NamesAndTypesList filter(const NameSet & names) const;
|
||||
|
@ -260,7 +260,7 @@ struct DeltaLakeMetadataParser<Configuration, MetadataReadHelper>::Impl
|
||||
auto columns = ParquetSchemaReader(*buf, format_settings).readSchema();
|
||||
|
||||
/// Read only columns that we need.
|
||||
columns.filterOut(NameSet{"add", "remove"});
|
||||
columns.filterColumns(NameSet{"add", "remove"});
|
||||
Block header;
|
||||
for (const auto & column : columns)
|
||||
header.insert({column.type->createColumn(), column.type, column.name});
|
||||
|
@ -71,23 +71,23 @@ struct HudiMetadataParser<Configuration, MetadataReadHelper>::Impl
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Unexpected format for file: {}", key);
|
||||
|
||||
const auto partition = key_file.parent_path().stem();
|
||||
const auto file_id = file_parts[0];
|
||||
const auto & file_id = file_parts[0];
|
||||
const auto timestamp = parse<UInt64>(file_parts[2]);
|
||||
|
||||
auto & file_info = data_files[partition][file_id];
|
||||
if (file_info.timestamp == 0 || file_info.timestamp < timestamp)
|
||||
{
|
||||
file_info.key = key;
|
||||
file_info.key = std::move(key);
|
||||
file_info.timestamp = timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
Strings result;
|
||||
for (const auto & [partition, partition_data] : data_files)
|
||||
for (auto & [partition, partition_data] : data_files)
|
||||
{
|
||||
LOG_TRACE(log, "Adding {} data files from partition {}", partition, partition_data.size());
|
||||
for (const auto & [file_id, file_data] : partition_data)
|
||||
result.push_back(file_data.key);
|
||||
for (auto & [file_id, file_data] : partition_data)
|
||||
result.push_back(std::move(file_data.key));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user