code: private void addAttribute(Field field, int begin, int end) {
          FieldPosition pos = new FieldPosition(field);
          pos.setBeginIndex(begin);
          pos.setEndIndex(end);
          attributes.add(pos);
      }
docs: [Spark/CDL] Use this method to add attribute.