Skip to content

Support '0' value for parse_capacity_limit()#22014

Merged
kosiew merged 5 commits intoapache:mainfrom
mkleen:capacity-0
May 8, 2026
Merged

Support '0' value for parse_capacity_limit()#22014
kosiew merged 5 commits intoapache:mainfrom
mkleen:capacity-0

Conversation

@mkleen
Copy link
Copy Markdown
Contributor

@mkleen mkleen commented May 5, 2026

Which issue does this PR close?

  • None

Rationale for this change

This extends parse_capacity_limit() to support `0` to set a limit of 0 instead of using `0K`.
This simplifies configuration and avoids confusion with the word `OK` (Okay).
This is based on the suggestion from @martin-g.

Usage:

SET datafusion.runtime.example_limit = '0'

instead of:

SET datafusion.runtime.example_limit = '0K'

What changes are included in this PR?

see above.

Are these changes tested?

Yes.

Are there any user-facing changes?

Yes.

Copy link
Copy Markdown
Contributor

@kosiew kosiew left a comment

Choose a reason for hiding this comment

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

@mkleen
The change looks good overall and I did not find any blocking issues. I left one small suggestion around SQL-level regression coverage to help ensure the config path stays wired correctly.

Comment thread datafusion/core/src/execution/context/mod.rs
@kosiew
Copy link
Copy Markdown
Contributor

kosiew commented May 6, 2026

@mkleen

datafusion/execution/src/runtime_env.rs
in fn create_runtime_config_entries, the runtime config descriptions shown by information_schema/SHOW still say capacity limits support only K/M/G suffixes.

Since this PR adds bare 0 as a supported SQL-facing value for all parse_capacity_limit callers, consider updating the descriptions for memory_limit, max_temp_directory_size, metadata_cache_limit, and list_files_cache_limit to mention the special 0 value.

@mkleen
Copy link
Copy Markdown
Contributor Author

mkleen commented May 6, 2026

@kosiew Thanks for the review, i will do a follow-up here soon.

@github-actions github-actions Bot added sqllogictest SQL Logic Tests (.slt) execution Related to the execution crate labels May 7, 2026
@mkleen mkleen requested a review from kosiew May 7, 2026 12:00
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 7, 2026
@kosiew kosiew added this pull request to the merge queue May 8, 2026
Merged via the queue into apache:main with commit 2f29038 May 8, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate documentation Improvements or additions to documentation execution Related to the execution crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants