This commit is contained in:
Aliaksandr Valialkin 2024-05-18 23:33:35 +02:00
parent ce34e93874
commit bf2a031382
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB
2 changed files with 11 additions and 2 deletions

View file

@ -137,6 +137,9 @@ func (br *blockResult) initFromFilterNeededColumns(brSrc *blockResult, bm *bitma
} }
func (br *blockResult) appendFilteredColumn(brSrc *blockResult, cSrc *blockResultColumn, bm *bitmap) { func (br *blockResult) appendFilteredColumn(brSrc *blockResult, cSrc *blockResultColumn, bm *bitmap) {
if len(br.timestamps) == 0 {
return
}
cDst := blockResultColumn{ cDst := blockResultColumn{
name: cSrc.name, name: cSrc.name,
} }
@ -210,7 +213,8 @@ func (br *blockResult) sizeBytes() int {
// The returned result is valid only until rcs are modified. // The returned result is valid only until rcs are modified.
func (br *blockResult) setResultColumns(rcs []resultColumn) { func (br *blockResult) setResultColumns(rcs []resultColumn) {
br.reset() br.reset()
if len(rcs) == 0 {
if len(rcs) == 0 || len(rcs[0].values) == 0 {
return return
} }

View file

@ -87,10 +87,15 @@ func (s *Storage) runQuery(ctx context.Context, tenantIDs []TenantID, q *Query,
} }
pp := newDefaultPipeProcessor(func(workerID uint, br *blockResult) { pp := newDefaultPipeProcessor(func(workerID uint, br *blockResult) {
if len(br.timestamps) == 0 {
return
}
brs := getBlockRows() brs := getBlockRows()
csDst := brs.cs csDst := brs.cs
for _, c := range br.getColumns() { cs := br.getColumns()
for _, c := range cs {
values := c.getValues(br) values := c.getValues(br)
csDst = append(csDst, BlockColumn{ csDst = append(csDst, BlockColumn{
Name: c.name, Name: c.name,