Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion be/test/storage/index/ann/ann_index_edge_case_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ TEST_F(VectorSearchTest, TestLargeVectorDimensions) {
vectors[i] = static_cast<float>(i % 100) / 100.0f;
}

std::vector<size_t> offsets = {0, dim, 2 * dim};
std::vector<uint64_t> offsets = {0, dim, 2 * dim};

Status status = writer->add_array_values(sizeof(float),
reinterpret_cast<const uint8_t*>(vectors.data()),
Expand Down
30 changes: 15 additions & 15 deletions be/test/storage/index/ann/ann_index_writer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ TEST_F(AnnIndexWriterTest, TestAddArrayValuesSuccess) {
9.0f, 10.0f, 11.0f, 12.0f // Row 2
};

std::vector<size_t> offsets = {0, 4, 8, 12}; // Each row has 4 elements
std::vector<uint64_t> offsets = {0, 4, 8, 12}; // Each row has 4 elements

Status status = writer->add_array_values(sizeof(float),
reinterpret_cast<const uint8_t*>(vectors.data()),
Expand Down Expand Up @@ -310,7 +310,7 @@ TEST_F(AnnIndexWriterTest, TestAddArrayValuesWrongDimension) {
4.0f, 5.0f, 6.0f // Row 1: 3 elements (wrong)
};

std::vector<size_t> offsets = {0, 3, 6}; // Each row has 3 elements instead of 4
std::vector<uint64_t> offsets = {0, 3, 6}; // Each row has 3 elements instead of 4

Status status = writer->add_array_values(sizeof(float),
reinterpret_cast<const uint8_t*>(vectors.data()),
Expand Down Expand Up @@ -405,7 +405,7 @@ TEST_F(AnnIndexWriterTest, TestFinish) {
5.0f, 6.0f, 7.0f, 8.0f // Row 1
};

std::vector<size_t> offsets = {0, 4, 8};
std::vector<uint64_t> offsets = {0, 4, 8};

ASSERT_TRUE(writer->add_array_values(sizeof(float),
reinterpret_cast<const uint8_t*>(vectors.data()), nullptr,
Expand Down Expand Up @@ -436,7 +436,7 @@ TEST_F(AnnIndexWriterTest, TestFullWorkflow) {
{
const size_t num_rows = 2;
std::vector<float> vectors = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f};
std::vector<size_t> offsets = {0, 4, 8};
std::vector<uint64_t> offsets = {0, 4, 8};

ASSERT_TRUE(writer->add_array_values(sizeof(float),
reinterpret_cast<const uint8_t*>(vectors.data()),
Expand All @@ -449,7 +449,7 @@ TEST_F(AnnIndexWriterTest, TestFullWorkflow) {
const size_t num_rows = 3;
std::vector<float> vectors = {9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f,
15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f};
std::vector<size_t> offsets = {0, 4, 8, 12};
std::vector<uint64_t> offsets = {0, 4, 8, 12};

ASSERT_TRUE(writer->add_array_values(sizeof(float),
reinterpret_cast<const uint8_t*>(vectors.data()),
Expand Down Expand Up @@ -525,7 +525,7 @@ TEST_F(AnnIndexWriterTest, TestNoTrainIndexAddsAtFinish) {
for (size_t i = 0; i < vectors.size(); ++i) {
vectors[i] = static_cast<float>(batch * vectors.size() + i);
}
std::vector<size_t> offsets;
std::vector<uint64_t> offsets;
for (size_t row = 0; row <= batch_rows; ++row) {
offsets.push_back(row * dim);
}
Expand Down Expand Up @@ -582,7 +582,7 @@ TEST_F(AnnIndexWriterTest, TestNoTrainIndexSkipsWhenRowsLessThanMinSegmentRows)
for (size_t i = 0; i < vectors.size(); ++i) {
vectors[i] = static_cast<float>(i);
}
std::vector<size_t> offsets;
std::vector<uint64_t> offsets;
for (size_t row = 0; row <= num_rows; ++row) {
offsets.push_back(row * dim);
}
Expand Down Expand Up @@ -626,7 +626,7 @@ TEST_F(AnnIndexWriterTest, TestTrainRequiredIndexUsesEffectiveMinSegmentRows) {
for (size_t i = 0; i < vectors.size(); ++i) {
vectors[i] = static_cast<float>(i);
}
std::vector<size_t> offsets;
std::vector<uint64_t> offsets;
for (size_t row = 0; row <= num_rows; ++row) {
offsets.push_back(row * dim);
}
Expand Down Expand Up @@ -684,7 +684,7 @@ TEST_F(AnnIndexWriterTest, TestCreateFromIndexColumnWriter) {
9.0f, 10.0f, 11.0f, 12.0f // Row 2
};

std::vector<size_t> offsets = {0, 4, 8, 12}; // Each row has 4 elements
std::vector<uint64_t> offsets = {0, 4, 8, 12}; // Each row has 4 elements

status = column_writer->add_array_values(sizeof(float),
reinterpret_cast<const uint8_t*>(vectors.data()),
Expand Down Expand Up @@ -722,7 +722,7 @@ TEST_F(AnnIndexWriterTest, TestAddArrayValuesIVF) {
9.0f, 10.0f, 11.0f, 12.0f // Row 2
};

std::vector<size_t> offsets = {0, 4, 8, 12}; // Each row has 4 elements
std::vector<uint64_t> offsets = {0, 4, 8, 12}; // Each row has 4 elements

Status status = writer->add_array_values(sizeof(float),
reinterpret_cast<const uint8_t*>(vectors.data()),
Expand Down Expand Up @@ -762,7 +762,7 @@ TEST_F(AnnIndexWriterTest, TestSmallTrainRequiredIndexUsesMemoryBuffer) {
for (size_t i = 0; i < vectors.size(); ++i) {
vectors[i] = static_cast<float>(i);
}
std::vector<size_t> offsets;
std::vector<uint64_t> offsets;
for (size_t row = 0; row <= num_rows; ++row) {
offsets.push_back(row * dim);
}
Expand Down Expand Up @@ -829,7 +829,7 @@ TEST_F(AnnIndexWriterTest, TestTrainRequiredIndexTrainsOnceAndAddsAllRows) {
17.0f, 18.0f, 19.0f, 20.0f, // Row 4
21.0f, 22.0f, 23.0f, 24.0f // Row 5
};
std::vector<size_t> offsets = {0, 4, 8, 12, 16, 20, 24};
std::vector<uint64_t> offsets = {0, 4, 8, 12, 16, 20, 24};

Status status = writer->add_array_values(sizeof(float),
reinterpret_cast<const uint8_t*>(vectors.data()),
Expand All @@ -847,7 +847,7 @@ TEST_F(AnnIndexWriterTest, TestTrainRequiredIndexTrainsOnceAndAddsAllRows) {
41.0f, 42.0f, 43.0f, 44.0f, // Row 10
45.0f, 46.0f, 47.0f, 48.0f // Row 11
};
std::vector<size_t> offsets = {0, 4, 8, 12, 16, 20, 24};
std::vector<uint64_t> offsets = {0, 4, 8, 12, 16, 20, 24};

Status status = writer->add_array_values(sizeof(float),
reinterpret_cast<const uint8_t*>(vectors.data()),
Expand Down Expand Up @@ -899,7 +899,7 @@ TEST_F(AnnIndexWriterTest, TestTrainRequiredIndexTrainsWithAllBufferedRows) {
vectors[row * dim + col] = static_cast<float>(row);
}
}
std::vector<size_t> offsets;
std::vector<uint64_t> offsets;
for (size_t row = 0; row <= num_rows; ++row) {
offsets.push_back(row * dim);
}
Expand Down Expand Up @@ -957,7 +957,7 @@ TEST_F(AnnIndexWriterTest, TestSkipIndexWhenTotalRowsLessThanMinTrainRows) {
for (size_t i = 0; i < vectors.size(); ++i) {
vectors[i] = static_cast<float>(i);
}
std::vector<size_t> offsets;
std::vector<uint64_t> offsets;
for (size_t row = 0; row <= num_rows; ++row) {
offsets.push_back(row * dim);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class SniiAnnContainerTest : public testing::Test {
// finish_ann_index() below cannot express.
static Status feed_and_finish(AnnIndexColumnWriter* ann) {
const std::vector<float> vectors = make_vectors();
std::vector<size_t> offsets(kRows + 1);
std::vector<uint64_t> offsets(kRows + 1);
for (uint32_t i = 0; i <= kRows; ++i) {
offsets[i] = static_cast<size_t>(i) * kDim;
}
Expand Down
Loading