<commit_before>package bamboo.crawl;

import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.sqlobject.*;
import org.skife.jdbi.v2.sqlobject.customizers.RegisterMapper;
import org.skife.jdbi.v2.sqlobject.mixins.Transactional;
import org.skife.jdbi.v2.tweak.ResultSetMapper;

import java.nio.file.Paths;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Iterator;
import java.util.List;

@RegisterMapper({WarcsDAO.WarcMapper.class, WarcsDAO.CollectionWarcMapper.class, WarcsDAO.WarcResumptionTokenMapper.class})
public interface WarcsDAO extends Transactional<WarcsDAO> {

    class WarcMapper implements ResultSetMapper<Warc> {
        @Override
        public Warc map(int i, ResultSet rs, StatementContext statementContext) throws SQLException {
            Warc warc = new Warc();
            warc.setId(rs.getLong("id"));
            warc.setCrawlId(rs.getLong("crawl_id"));
            warc.setStateId(rs.getInt("warc_state_id"));
            warc.setPath(Paths.get(rs.getString("path")));
            warc.setSize(rs.getLong("size"));
            warc.setRecords(rs.getLong("records"));
            warc.setRecordBytes(rs.getLong("record_bytes"));
            warc.setFilename(rs.getString("filename"));
            warc.setSha256(rs.getString("sha256"));
            warc.setBlobId((Long)rs.getObject("blob_id"));
            return warc;
        }
    }

    interface InsertableWarc {
        long getStateId();
        String getPath();
        String getFilename();
        long getSize();
        String getSha256();<commit_msg>Cope with null path<commit_after>package bamboo.crawl;

import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.sqlobject.*;
import org.skife.jdbi.v2.sqlobject.customizers.RegisterMapper;
import org.skife.jdbi.v2.sqlobject.mixins.Transactional;
import org.skife.jdbi.v2.tweak.ResultSetMapper;

import java.nio.file.Paths;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Iterator;
import java.util.List;

@RegisterMapper({WarcsDAO.WarcMapper.class, WarcsDAO.CollectionWarcMapper.class, WarcsDAO.WarcResumptionTokenMapper.class})
public interface WarcsDAO extends Transactional<WarcsDAO> {

    class WarcMapper implements ResultSetMapper<Warc> {
        @Override
        public Warc map(int i, ResultSet rs, StatementContext statementContext) throws SQLException {
            Warc warc = new Warc();
            warc.setId(rs.getLong("id"));
            warc.setCrawlId(rs.getLong("crawl_id"));
            warc.setStateId(rs.getInt("warc_state_id"));
            String path = rs.getString("path");
            warc.setPath(path == null ? null : Paths.get(path));
            warc.setSize(rs.getLong("size"));
            warc.setRecords(rs.getLong("records"));
            warc.setRecordBytes(rs.getLong("record_bytes"));
            warc.setFilename(rs.getString("filename"));
            warc.setSha256(rs.getString("sha256"));
            warc.setBlobId((Long)rs.getObject("blob_id"));
            return warc;
        }
    }

    interface InsertableWarc {
        long getStateId();
        String getPath();
        String getFilename();
        long getSize();
        String getSha256();
{'fraction_non_alphanumeric': 0.12362301101591187, 'fraction_numerical': 0.008567931456548347, 'mean_word_length': 3.2344559585492227, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2116943', 'n_tokens_mistral': 1057, 'n_tokens_neox': 1035, 'n_words': 158}