mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 17:32:32 +00:00
Apply suggestions from code review
Co-authored-by: János Benjamin Antal <antaljanosbenjamin@users.noreply.github.com>
This commit is contained in:
parent
33a39900ad
commit
bb38918a26
@ -417,7 +417,7 @@ std::optional<std::pair<std::vector<String>, DataTypes>> CSVSchemaReader::readRo
|
||||
|
||||
auto fields = reader.readRow();
|
||||
auto data_types = tryInferDataTypesByEscapingRule(fields, format_settings, FormatSettings::EscapingRule::CSV);
|
||||
return std::make_pair(fields, data_types);
|
||||
return std::make_pair(std::move(fields), std::move(data_types));
|
||||
}
|
||||
|
||||
std::optional<DataTypes> CSVSchemaReader::readRowAndGetDataTypesImpl()
|
||||
|
@ -388,7 +388,7 @@ std::optional<std::pair<std::vector<String>, DataTypes>> CustomSeparatedSchemaRe
|
||||
|
||||
auto fields = reader.readRow();
|
||||
auto data_types = tryInferDataTypesByEscapingRule(fields, reader.getFormatSettings(), reader.getEscapingRule(), &json_inference_info);
|
||||
return std::make_pair(fields, data_types);
|
||||
return std::make_pair(std::move(fields), std::move(data_types));
|
||||
}
|
||||
|
||||
std::optional<DataTypes> CustomSeparatedSchemaReader::readRowAndGetDataTypesImpl()
|
||||
|
@ -425,7 +425,7 @@ void FormatWithNamesAndTypesSchemaReader::tryDetectHeader(std::vector<String> &
|
||||
if (!first_row)
|
||||
return;
|
||||
|
||||
auto [first_row_values, first_row_types] = *first_row;
|
||||
const auto & [first_row_values, first_row_types] = *first_row;
|
||||
|
||||
/// The first row contains non String elements, it cannot be a header.
|
||||
if (!checkIfAllTypesAreString(first_row_types))
|
||||
@ -443,7 +443,7 @@ void FormatWithNamesAndTypesSchemaReader::tryDetectHeader(std::vector<String> &
|
||||
return;
|
||||
}
|
||||
|
||||
auto [second_row_values, second_row_types] = *second_row;
|
||||
const auto & [second_row_values, second_row_types] = *second_row;
|
||||
|
||||
DataTypes data_types;
|
||||
bool second_row_can_be_type_names = checkIfAllTypesAreString(second_row_types) && checkIfAllValuesAreTypeNames(readNamesFromFields(second_row_values));
|
||||
|
Loading…
Reference in New Issue
Block a user