diff --git a/dbms/src/Dictionaries/PolygonDictionary.cpp b/dbms/src/Dictionaries/PolygonDictionary.cpp index 63d609343bc..9cf7878dfeb 100644 --- a/dbms/src/Dictionaries/PolygonDictionary.cpp +++ b/dbms/src/Dictionaries/PolygonDictionary.cpp @@ -27,6 +27,8 @@ IPolygonDictionary::IPolygonDictionary( , source_ptr(std::move(source_ptr_)) , dict_lifetime(dict_lifetime_) { + createAttributes(); + loadData(); } std::string IPolygonDictionary::getName() const @@ -132,7 +134,7 @@ void IPolygonDictionary::calculateBytesAllocated() } -void IPolygonDictionary::has(const Columns &key_columns, const DataTypes &key_types, PaddedPODArray &out) { +void IPolygonDictionary::has(const Columns &key_columns, const DataTypes &key_types, PaddedPODArray &out) const { // TODO: Use constant in error message? if (key_types.size() != DIM) throw Exception{"Expected two columns of coordinates", ErrorCodes::BAD_ARGUMENTS}; @@ -228,8 +230,6 @@ std::shared_ptr SimplePolygonDictionary::clone() const this->dict_lifetime); } -void SimplePolygonDictionary::generate() {} - bool SimplePolygonDictionary::find(const Point &point, size_t & id) const { for (size_t i = 0; i < (this->polygons).size(); ++i) diff --git a/dbms/src/Dictionaries/PolygonDictionary.h b/dbms/src/Dictionaries/PolygonDictionary.h index ed8dfff4077..1c5ae8b519a 100644 --- a/dbms/src/Dictionaries/PolygonDictionary.h +++ b/dbms/src/Dictionaries/PolygonDictionary.h @@ -50,7 +50,7 @@ public: BlockInputStreamPtr getBlockInputStream(const Names & column_names, size_t max_block_size) const override; // TODO: Refactor design to perform stronger checks, i.e. make this an override. - void has(const Columns & key_columns, const DataTypes & key_types, PaddedPODArray & out) ; + void has(const Columns & key_columns, const DataTypes & key_types, PaddedPODArray & out) const; protected: using Point = bg::model::point; @@ -59,7 +59,6 @@ protected: std::vector polygons; - virtual void generate() = 0; virtual bool find(const Point & point, size_t & id) const = 0; const std::string name; @@ -101,7 +100,6 @@ public: std::shared_ptr clone() const override; private: - void generate() override; bool find(const Point & point, size_t & id) const override; };