private List<LineAndError> getLineAndError(BatchWriteRowResult result, List<OTSLine> lines) {
    List<LineAndError> errors = new ArrayList<LineAndError>();

    switch (conf.getOperation()) {
      case PUT_ROW:
        List<RowStatus> putStatus = result.getPutRowStatus(conf.getTableName());
        for (int i = 0; i < putStatus.size(); i++) {
          if (!putStatus.get(i).isSucceed()) {
            errors.add(new LineAndError(lines.get(i), putStatus.get(i).getError()));
          }
        }
        break;
      case UPDATE_ROW:
        List<RowStatus> updateStatus = result.getUpdateRowStatus(conf.getTableName());
        for (int i = 0; i < updateStatus.size(); i++) {
          if (!updateStatus.get(i).isSucceed()) {
            errors.add(new LineAndError(lines.get(i), updateStatus.get(i).getError()));
          }
        }
        break;
      default:
        throw new RuntimeException(
            String.format(OTSErrorMessage.OPERATION_PARSE_ERROR, conf.getOperation()));
    }
    return errors;
  }