Skip to content

Conversation

jsai28
Copy link
Contributor

@jsai28 jsai28 commented Apr 4, 2025

Which issue does this PR close?

Closes #15553.

Rationale for this change

Allows users to specify a disk limit for spill queries.

What changes are included in this PR?

A CLI option for users to specify a disk limit.

Are these changes tested?

Are there any user-facing changes?

Yes, new CLI option in datafusion-cli.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 4, 2025
@jsai28 jsai28 marked this pull request as ready for review April 5, 2025 00:14
Copy link
Contributor

@2010YOUY01 2010YOUY01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, it looks good to me.

A small clarification: if this config is not explicitly set, DataFusion defaults to 100 GB rather than unlimited.

Test result:

yongting@Mac ~/C/d/datafusion-cli (pr-15586) [1]> cargo run --profile release-nonlto -- --mem-pool-type fair --memory-limit 100M --disk-limit 10M -c 'select * from generate_series(1, 1000000000) as t1(v1) order by v1'
    Finished `release-nonlto` profile [optimized] target(s) in 0.12s
     Running `/Users/yongting/Code/datafusion/target/release-nonlto/datafusion-cli --mem-pool-type fair --memory-limit 100M --disk-limit 10M -c 'select * from generate_series(1, 1000000000) as t1(v1) order by v1'`
DataFusion CLI v46.0.1
Error: Resources exhausted: The used disk space during the spilling process has exceeded the allowable limit of 10.0 MB. Try increasing the `max_temp_directory_size` in the disk manager configuration.

#[clap(
short = 'd',
long,
help = "Available disk space for spilling queries (e.g. '10g'), default to None (no limit)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
help = "Available disk space for spilling queries (e.g. '10g'), default to None (no limit)",
help = "Available disk space for spilling queries (e.g. '10g'), default to None (use DataFusion's default value of '100g')",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated!

Specify the memory pool type 'greedy' or 'fair', default to 'greedy'

-d, --disk-limit <DISK_LIMIT>
Available disk space for spilling queries (e.g. '10g'), default to None (no limit)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Available disk space for spilling queries (e.g. '10g'), default to None (no limit)
Available disk space for spilling queries (e.g. '10g'), default to None (use DataFusion's default value of '100g')

@2010YOUY01 2010YOUY01 merged commit 6afd539 into apache:main Apr 6, 2025
29 checks passed
@jsai28 jsai28 deleted the add-disk-usage-limit-configuration-to-datafusion-cli branch April 6, 2025 03:55
nirnayroy pushed a commit to nirnayroy/datafusion that referenced this pull request May 2, 2025
* added disk limit option

* run prettier and cargo fmt

* help line update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add disk usage limit configuration to datafusion-cli

2 participants