public void populateRefTables() throws IOException, SQLException {
        boolean refTablesPopulated = true;
        try {
            Connection connection = dbUtil.getConnection();
            for (TableInfo tableInfo : getRefTableInfos()) {
                int rows = 0;
                try (ResultSet rs = connection
                        .createStatement()
                        .executeQuery("select * from " + tableInfo.getName())) {
                    while (rs.next()) {
                        rows++;
                    }
                }
                if (rows == 0) {
                    refTablesPopulated = false;
                    break;
                }

            }
        } catch (SQLException e) {
            //swallow
        }
        if (refTablesPopulated) {
            LOG.info("ref tables are already populated");
            return;
        }

        IDBWriter writer = getDBWriter(getRefTableInfos());
        Map<Cols, String> m = new HashMap<>();
        for (AbstractProfiler.PARSE_ERROR_TYPE t : AbstractProfiler.PARSE_ERROR_TYPE.values()) {
            m.clear();
            m.put(Cols.PARSE_ERROR_ID, Integer.toString(t.ordinal()));
            m.put(Cols.PARSE_ERROR_DESCRIPTION, t.name());
            writer.writeRow(AbstractProfiler.REF_PARSE_ERROR_TYPES, m);
        }

        for (AbstractProfiler.EXCEPTION_TYPE t : AbstractProfiler.EXCEPTION_TYPE.values()) {
            m.clear();
            m.put(Cols.PARSE_EXCEPTION_ID, Integer.toString(t.ordinal()));
            m.put(Cols.PARSE_EXCEPTION_DESCRIPTION, t.name());
            writer.writeRow(AbstractProfiler.REF_PARSE_EXCEPTION_TYPES, m);
        }

        for (ExtractReaderException.TYPE t : ExtractReaderException.TYPE.values()) {
            m.clear();
            m.put(Cols.EXTRACT_EXCEPTION_ID, Integer.toString(t.ordinal()));
            m.put(Cols.EXTRACT_EXCEPTION_DESCRIPTION, t.name());
            writer.writeRow(AbstractProfiler.REF_EXTRACT_EXCEPTION_TYPES, m);
        }
        writer.close();
    }
@return the main tables, not including the ref tables
tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/batch/EvalConsumerBuilder.java