code: func validRange(sc *stmtctx.StatementContext, ran *ranger.Range, encoded bool) bool {
  	var low, high []byte
  	if encoded {
  		low, high = ran.LowVal[0].GetBytes(), ran.HighVal[0].GetBytes()
  	} else {
  		var err error
  		low, err = codec.EncodeKey(sc, nil, ran.LowVal[0])
  		if err != nil {
  			return false
  		}
  		high, err = codec.EncodeKey(sc, nil, ran.HighVal[0])
  		if err != nil {
  			return false
  		}
  	}
  	if ran.LowExclude {
  		low = kv.Key(low).PrefixNext()
  	}
  	if !ran.HighExclude {
  		high = kv.Key(high).PrefixNext()
  	}
  	return bytes.Compare(low, high) < 0
  }
docs: // validRange checks if the range is Valid, it is used by `SplitRange` to remove the invalid range,
  // the possible types of range are index key range and handle key range.