Skip to content

Commit

Permalink
fix: panic for nil scratch values (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorfour authored Mar 27, 2024
1 parent 51d3d3d commit fd03a9a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions query/physicalplan/binaryscalarexpr.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,24 @@ func (e BinaryScalarExpr) EvalParquet(rg parquet.RowGroup, in [][]parquet.Value)
switch t := e.Right.(type) {
case *scalar.Binary:
if t.String() != "" { // treat empty string equivalent to nil
return res, nil, nil
return res, in, nil
}
case *scalar.String:
if t.String() != "" { // treat empty string equivalent to nil
return res, nil, nil
return res, in, nil
}
}
}
case logicalplan.OpNotEq: // missing column; looking for != nil
if !e.Right.IsValid() {
return res, nil, nil
return res, in, nil
}
case logicalplan.OpLt, logicalplan.OpLtEq, logicalplan.OpGt, logicalplan.OpGtEq:
return res, nil, nil
return res, in, nil
}

res.AddRange(0, uint64(rg.NumRows()))
return res, nil, nil
return res, in, nil
}

// Reuse the input slice if it's already been allocated
Expand Down
2 changes: 1 addition & 1 deletion query/physicalplan/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (a *AndExpr) EvalParquet(rg parquet.RowGroup, in [][]parquet.Value) (*Bitma
}

if left.IsEmpty() {
return left, nil, nil
return left, lout, nil
}

right, rout, err := a.Right.EvalParquet(rg, lout)
Expand Down
4 changes: 2 additions & 2 deletions query/physicalplan/regexpfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ func (f *RegExpFilter) EvalParquet(rg parquet.RowGroup, in [][]parquet.Value) (*
for i := uint32(0); i < uint32(rg.NumRows()); i++ {
res.Add(i)
}
return res, nil, nil
return res, in, nil
}
return res, nil, nil
return res, in, nil
}

// Reuse the input slice if it's already been allocated
Expand Down

0 comments on commit fd03a9a

Please sign in to comment.