code: func (c *Chunk) TruncateTo(numRows int) {
  	for _, col := range c.columns {
  		if col.isFixed() {
  			elemLen := len(col.elemBuf)
  			col.data = col.data[:numRows*elemLen]
  		} else {
  			col.data = col.data[:col.offsets[numRows]]
  			col.offsets = col.offsets[:numRows+1]
  		}
  		for i := numRows; i < col.length; i++ {
  			if col.isNull(i) {
  				col.nullCount--
  			}
  		}
  		col.length = numRows
  		bitmapLen := (col.length + 7) / 8
  		col.nullBitmap = col.nullBitmap[:bitmapLen]
  		if col.length%8 != 0 {
  			// When we append null, we simply increment the nullCount,
  			// so we need to clear the unused bits in the last bitmap byte.
  			lastByte := col.nullBitmap[bitmapLen-1]
  			unusedBitsLen := 8 - uint(col.length%8)
  			lastByte <<= unusedBitsLen
  			lastByte >>= unusedBitsLen
  			col.nullBitmap[bitmapLen-1] = lastByte
  		}
  	}
  	c.numVirtualRows = numRows
  }
docs: // TruncateTo truncates rows from tail to head in a Chunk to "numRows" rows.