public static List<Integer> genReadColsIndexes(TableMeta meta, String[] readCols) { if (readCols == null || readCols.length == 0 || readCols[0] == null || readCols[0].trim().length() == 0) { return null; } List<Integer> indexes = new ArrayList<Integer>(); for (String col : readCols) { boolean found = false; for (int j = 0; j < meta.getCols().length; ++j) { if (meta.getCols()[j].getName().equals(col)) { indexes.add(j); found = true; break; } } if (!found) { throw new RuntimeException( ExceptionCode.ODPS_0720021 + " - " + col + " in table " + meta.getProjName() + "." + meta.getTableName()); } } return indexes; }