mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Merge pull request #68644 from linkwk7/fix_full_text_with_multi_col
Fix wrong row id when using full text index with multi column
This commit is contained in:
commit
31a376953d
@ -128,14 +128,14 @@ void MergeTreeIndexAggregatorFullText::update(const Block & block, size_t * pos,
|
||||
"Position: {}, Block rows: {}.", *pos, block.rows());
|
||||
|
||||
size_t rows_read = std::min(limit, block.rows() - *pos);
|
||||
auto row_id = store->getNextRowIDRange(rows_read);
|
||||
auto start_row_id = row_id;
|
||||
auto start_row_id = store->getNextRowIDRange(rows_read);
|
||||
|
||||
for (size_t col = 0; col < index_columns.size(); ++col)
|
||||
{
|
||||
const auto & column_with_type = block.getByName(index_columns[col]);
|
||||
const auto & column = column_with_type.column;
|
||||
size_t current_position = *pos;
|
||||
auto row_id = start_row_id;
|
||||
|
||||
bool need_to_write = false;
|
||||
if (isArray(column_with_type.type))
|
||||
|
@ -0,0 +1,2 @@
|
||||
Query column at granularity boundary
|
||||
0,0 0,1
|
18
tests/queries/0_stateless/03228_full_text_with_multi_col.sql
Normal file
18
tests/queries/0_stateless/03228_full_text_with_multi_col.sql
Normal file
@ -0,0 +1,18 @@
|
||||
SET allow_experimental_full_text_index=1;
|
||||
|
||||
DROP TABLE IF EXISTS multi_col_ivt;
|
||||
|
||||
CREATE TABLE tab (
|
||||
v0 String,
|
||||
v1 String,
|
||||
INDEX idx (v0, v1) TYPE full_text GRANULARITY 1)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY tuple()
|
||||
SETTINGS index_granularity = 1;
|
||||
|
||||
INSERT INTO tab VALUES('0,0', '0,1')('2,2','2,3');
|
||||
|
||||
SELECT 'Query column at granularity boundary';
|
||||
SELECT * FROM tab WHERE hasToken(v1, '1');
|
||||
|
||||
DROP TABLE tab;
|
Loading…
Reference in New Issue
Block a user