/** * Get the column index of the column with the provided ID. * This method is not part of the stable API. * @param columnId the column id of the column * @return the column index of the column. */ public int getColumnIndex(int columnId) { if (!hasColumnIds()) { throw new IllegalStateException("Schema does not have Column IDs"); } Integer index = this.columnsById.get(columnId); if (index == null) { throw new IllegalArgumentException( String.format("Unknown column id: %s", columnId)); } return index; }
assertTrue(kuduTable.getSchema().hasColumnIds());