Skip to content

Commit

Permalink
fix: no data is returned for full-text index query (#490)
Browse files Browse the repository at this point in the history
Signed-off-by: ZhangJian He <shoothzj@gmail.com>
  • Loading branch information
shoothzj committed Feb 28, 2024
1 parent 3adf273 commit 502f6cd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 0 additions & 1 deletion engine/column_store_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ func (r *ColumnStoreReader) Run(ctx context.Context) (iterCount, rowCountAfterFi
filterBitmap := bitmap.NewFilterBitmap(r.queryCtx.filterOption.CondFunctions.NumFilter())
colAux := record.ColAux{}
for {
filterBitmap.Reset()
select {
case <-r.closedCh:
return
Expand Down
1 change: 0 additions & 1 deletion engine/hybrid_store_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ func (r *HybridStoreReader) run(ctx context.Context, reader comm.KeyCursor) (err
var rec *record.Record
colAux := record.ColAux{}
for {
r.filterBitmap.Reset()
select {
case <-r.closedCh:
return
Expand Down
10 changes: 10 additions & 0 deletions engine/hybrid_store_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,16 @@ func TestHybridStoreReader(t *testing.T) {
expected: 0,
expect: testEqualChunkNum,
},
{
name: "select * from db0.rp0.mst where or",
q: `select field1_float,field2_int,field3_bool,field4_string from db0.rp0.mst where MATCHPHRASE(primaryKey_string1, 'test111') or MATCHPHRASE(primaryKey_string2, 'test')`,
tr: util.TimeRange{Min: 1635724800000000000, Max: 1635732800000000000},
out: buildComRowDataType(),
readerOps: buildComReaderOps(),
fields: fields,
expected: 1245,
expect: testEqualChunkNum,
},
} {
t.Run(tt.name, func(t *testing.T) {
if tt.skip {
Expand Down
3 changes: 2 additions & 1 deletion engine/immutable/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,8 @@ func FilterByFieldFuncs(rec, filterRec *record.Record, filterOption *BaseFilterO
return rec
}

filterBitmap.Reset()

if err := filterOption.CondFunctions.Filter(rec, filterBitmap); err != nil {
panic(err)
}
Expand All @@ -956,7 +958,6 @@ func FilterByFieldFuncs(rec, filterRec *record.Record, filterOption *BaseFilterO
}

if len(filterBitmap.ReserveId) == 0 {
filterBitmap.Reset()
return nil
}
return GenRecByReserveIds(rec, filterRec, filterBitmap.ReserveId, filterOption.RedIdxMap)
Expand Down

0 comments on commit 502f6cd

Please sign in to comment.