Fixed minor issues

This commit is contained in:
Maksim Kita 2021-03-04 02:19:48 +03:00
parent 8ea6c4b852
commit 252f7604ee
3 changed files with 17 additions and 4 deletions

View File

@ -136,10 +136,18 @@ void CacheDictionary<dictionary_key_type>::toParent(const PaddedPODArray<UInt64>
{
/// Run update on requested keys before fetch from storage
const auto & attribute_name = hierarchical_attribute->name;
auto result_type = std::make_shared<DataTypeUInt64>();
auto column = getColumnsImpl({attribute_name}, {result_type->createColumn()}, ids, {nullptr}).front();
const auto & values = assert_cast<const ColumnVector<UInt64> &>(*column);
out.assign(values.getData());
auto input_column = result_type->createColumn();
auto & input_column_typed = assert_cast<ColumnVector<UInt64> &>(*input_column);
auto & data = input_column_typed.getData();
data.insert(ids.begin(), ids.end());
auto column = getColumn({attribute_name}, result_type, {std::move(input_column)}, {result_type}, {nullptr});
const auto & result_column_typed = assert_cast<const ColumnVector<UInt64> &>(*column);
const auto & result_data = result_column_typed.getData();
out.assign(result_data);
}
else
throw Exception("Hierarchy is not supported for complex key CacheDictionary", ErrorCodes::UNSUPPORTED_METHOD);

View File

@ -336,7 +336,7 @@ private:
char * place_for_serialized_columns;
inline bool isDefault() const { return place_for_serialized_columns == nullptr; }
inline bool setDefault()
inline void setDefault()
{
place_for_serialized_columns = nullptr;
allocated_size_for_columns = 0;

View File

@ -81,6 +81,7 @@ public:
{
attributes_to_fetch_filter[i] = true;
attributes_default_value_providers.emplace_back(dictionary_attribute.null_value, attributes_default_values_columns[default_values_column_index]);
++default_values_column_index;
}
else
attributes_default_value_providers.emplace_back(dictionary_attribute.null_value);
@ -172,8 +173,12 @@ static inline void insertDefaultValuesIntoColumns(
const auto & default_value_provider = fetch_request.defaultValueProviderAtIndex(column_index);
if (fetch_request.shouldFillResultColumnWithIndex(column_index))
{
std::cerr << "insertDefaultValuesIntoColumns" << default_value_provider.getDefaultValue(row_index).dump() << std::endl;
column->insert(default_value_provider.getDefaultValue(row_index));
}
}
}
/// Deserialize column value and insert it in columns.