protected void encodeSubTable(FacesContext context, DataTable component, SubTable subTable, int first, int last) throws IOException {
        for (int i = first; i < last; i++) {
            component.setRowIndex(i);
            if (!component.isRowAvailable()) {
                break;
            }

            subTable.encodeAll(context);
        }
    }
Encodes dynamic column. Allows to override default behavior.
primefaces/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java