Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SortedTableMap fails with large datasets (30GB CSV) AssertionError #1057

Open
jankod opened this issue Feb 23, 2025 · 0 comments
Open

SortedTableMap fails with large datasets (30GB CSV) AssertionError #1057

jankod opened this issue Feb 23, 2025 · 0 comments

Comments

@jankod
Copy link

jankod commented Feb 23, 2025

AssertionError in flushPage when creating SortedTableMap from large CSV (30GB) I am encountering an AssertionError within the flushPage method of SortedTableMap when attempting to create a database from a 30GB CSV file. This issue does not occur with smaller CSV files (e.g., < 500MB)

Volume volume = MappedFileVol.FACTORY.makeVolume(dbPath, false);
SortedTableMap.Sink<Integer, byte[]> sink =
SortedTableMap.create(
volume,
Serializer.INTEGER,
Serializer.BYTE_ARRAY
)
.createFromSink();

BufferedReader reader = new BufferedReader(new FileReader(groupedCsvPath));
String line;

    while ((line = reader.readLine()) != null) {

        String[] parts = line.split(",", 2);


        double mass = Double.parseDouble(parts[0]);
        int massInt = (int) Math.round(mass * 10000);
        String seqAccs = parts[1];
        byte[] seqAccsBytes = BinaryPeptideDbUtil.writeGroupedRow(seqAccs);
        sink.put(massInt, seqAccsBytes);
    }
    SortedTableMap<Integer, byte[]> map = sink.create();

Exception:

Exception in thread "main" java.lang.AssertionError
at org.mapdb.SortedTableMap$Companion$createFromSink$1.flushPage(SortedTableMap.kt:213)
at org.mapdb.SortedTableMap$Companion$createFromSink$1.pairsToNodes(SortedTableMap.kt:191)
at org.mapdb.SortedTableMap$Companion$createFromSink$1.put(SortedTableMap.kt:139)
at org.mapdb.SortedTableMap$Companion$createFromSink$1.put(SortedTableMap.kt:117)
at org.mapdb.SortedTableMap$Sink.put(SortedTableMap.kt:24)

MapDB Version: 3.1.0
OS: macos (SSD disk) and linux ubuntu (HDD)
JVM Version: 23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant