mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
fix build
This commit is contained in:
parent
dadc29fb73
commit
941cceda7f
@ -1,6 +1,6 @@
|
|||||||
option(ENABLE_ANNOY "Enable Annoy index support" ${ENABLE_LIBRARIES})
|
option(ENABLE_ANNOY "Enable Annoy index support" ${ENABLE_LIBRARIES})
|
||||||
|
|
||||||
if (NOT ENABLE_ANNOY)
|
if ((NOT ENABLE_ANNOY) OR (SANITIZE STREQUAL "undefined"))
|
||||||
message (STATUS "Not using annoy")
|
message (STATUS "Not using annoy")
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
@ -143,7 +143,7 @@ void MergeTreeIndexAggregatorAnnoy::update(const Block & block, size_t * pos, si
|
|||||||
{
|
{
|
||||||
const auto & data = column_array->getData();
|
const auto & data = column_array->getData();
|
||||||
const auto & array = typeid_cast<const ColumnFloat32&>(data).getData();
|
const auto & array = typeid_cast<const ColumnFloat32&>(data).getData();
|
||||||
if (array.size() == 0)
|
if (array.empty())
|
||||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Array have 0 rows, but {} expected", rows_read);
|
throw Exception(ErrorCodes::LOGICAL_ERROR, "Array have 0 rows, but {} expected", rows_read);
|
||||||
const auto & offsets = column_array->getOffsets();
|
const auto & offsets = column_array->getOffsets();
|
||||||
size_t num_rows = offsets.size();
|
size_t num_rows = offsets.size();
|
||||||
@ -159,7 +159,7 @@ void MergeTreeIndexAggregatorAnnoy::update(const Block & block, size_t * pos, si
|
|||||||
}
|
}
|
||||||
index = std::make_shared<AnnoyIndex>(size);
|
index = std::make_shared<AnnoyIndex>(size);
|
||||||
|
|
||||||
index->add_item(index->get_n_items(), &array[0]);
|
index->add_item(index->get_n_items(), array.data());
|
||||||
/// add all rows from 1 to num_rows - 1 (this is the same as the beginning of the last element)
|
/// add all rows from 1 to num_rows - 1 (this is the same as the beginning of the last element)
|
||||||
for (size_t current_row = 0; current_row < num_rows; ++current_row)
|
for (size_t current_row = 0; current_row < num_rows; ++current_row)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user