class ModelConverterUtils {

    static Tuple2<Params, Iterable<String>> extractModelMetaAndData(List<Row> rows) {
        Integer[] order = orderModelRows(rows);

        // extract meta
        List<String> metaSegments = new ArrayList<>();
        for (int i = 0; i < order.length; i++) {
            long id = (Long) rows.get(order[i]).getField(0);
            int currStringId = getStringIndex(id);
            if (currStringId == 0) {
                metaSegments.add((String) rows.get(order[i]).getField(1));
            } else {
                break;
            }
        }
        String metaStr = mergeString(metaSegments);

        return Tuple2.of(Params.fromJson(metaStr), new StringDataIterable(rows, order));
    }

}