Skip to content

Commit

Permalink
Merge pull request #123 from ClickHouse/fix/low-cardinality-index
Browse files Browse the repository at this point in the history
fix(proto): handle index out of range in low cardinality
  • Loading branch information
ernado authored Jun 14, 2022
2 parents 56f0ebd + fe50213 commit a878abf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions proto/col_low_cardinality.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ func (c *ColLowCardinality[T]) DecodeColumn(r *Reader, rows int) error {

c.Values = c.Values[:0]
for _, idx := range c.keys {
if int64(idx) >= indexRows {
return errors.Errorf("key index out of range [%d] with length %d", idx, indexRows)
}
c.Values = append(c.Values, c.index.Row(idx))
}

Expand Down

0 comments on commit a878abf

Please sign in to comment.