Could not write temp file and throw Invalid argument during BIG table sort

Open
#156 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, sql
Domain
databases

Research direction

Start by reproducing the DuckDB CLI command against a comparable 56-million-row asset_tree table, sorting by hierarchy_path and observing the temporary files under /db/com.db.tmp. Done means the CREATE TABLE sort completes without the Invalid argument error or reports a confirmed platform or filesystem limitation.

Written by the indexing model from the issue text.

Description

As you can see below, i have a table with 56 million rows, and attemping to perform sorting to "hierarchy_path" column will cause it to fail with invalid argument. i observed 400 + tmp files are being created on and off during the execution and after 5 minutes it goes off with error, i consider it crashed or at least not completing the SQL to create the table.

duckdb "/db/com.db"
v1.2.1 8e52ec4395
Enter ".help" for usage hints.
D select count(*) from asset_tree;
┌─────────────────┐
│ count_star() │
│ int64 │
├─────────────────┤
│ 56452767 │
│ (56.45 million) │
└─────────────────┘
D

duckdb "/db/com.db"
v1.2.1 8e52ec4395
Enter ".help" for usage hints.
D create table eric as
select * from asset_tree order by hierarchy_path;
49% ▕█████████████████████████████▍ ▏ IO Error:
Could not write file "/db/com.db.tmp/duckdb_temp_block-4611686018427598582.block": Invalid argument
D .quit

Dominant language
C++
Stars
127
Forks
80
Avg merge
13h 41m
Merged PRs (30d)
44

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from duckdb/duckdb-java

All issues in duckdb/duckdb-java

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.