Add some comments

This commit is contained in:
achulkov2 2019-12-27 16:06:03 +03:00
parent 36e9d71daf
commit 288005162e
2 changed files with 10 additions and 2 deletions

View File

@ -90,7 +90,8 @@ bool IPolygonDictionary::isInjective(const std::string &) const
}
BlockInputStreamPtr IPolygonDictionary::getBlockInputStream(const Names &, size_t) const {
// TODO: Better error message.
// TODO: In order for this to work one would first have to support retrieving arrays from dictionaries.
// I believe this is a separate task done by some other people.
throw Exception{"Reading the dictionary is not allowed", ErrorCodes::UNSUPPORTED_METHOD};
}
@ -152,7 +153,8 @@ void IPolygonDictionary::appendNullValue(AttributeUnderlyingType type, const Fie
}
}
void IPolygonDictionary::createAttributes() {
void IPolygonDictionary::createAttributes()
{
attributes.resize(dict_struct.attributes.size());
for (size_t i = 0; i < dict_struct.attributes.size(); ++i)
{

View File

@ -186,6 +186,9 @@ private:
/** Checks whether a given attribute exists and returns its index */
size_t getAttributeIndex(const std::string & attribute_name) const;
/** Helper functions to retrieve and instantiate the provided null value of an attribute.
* Since a null value is obligatory for every attribute they are simply appended to null_values defined below.
*/
template <typename T>
void appendNullValueImpl(const Field & null_value);
void appendNullValue(AttributeUnderlyingType type, const Field & value);
@ -194,8 +197,11 @@ private:
template <typename AttributeType, typename OutputType, typename ValueSetter, typename DefaultGetter>
void getItemsImpl(size_t attribute_ind, const Columns & key_columns, ValueSetter && set_value, DefaultGetter && get_default) const;
/** A mapping from the names of the attributes to their index in the two vectors defined below. */
std::map<std::string, size_t> attribute_index_by_name;
/** A vector of columns storing the values of each attribute. */
Columns attributes;
/** A vector of null values corresponding to each attribute. */
std::vector<std::variant<
UInt8,
UInt16,