erenavsarogullari commented on code in PR #20372:
URL: https://github.com/apache/datafusion/pull/20372#discussion_r2868416355
##########
datafusion/core/src/execution/context/mod.rs:
##########
@@ -1236,33 +1236,38 @@ impl SessionContext {
Ok(())
}
- /// Parse memory limit from string to number of bytes
+ /// Parse capacity limit from string to number of bytes by allowing units:
K, M and G.
/// Supports formats like '1.5G', '100M', '512K'
///
/// # Examples
/// ```
/// use datafusion::execution::context::SessionContext;
///
/// assert_eq!(
- /// SessionContext::parse_memory_limit("1M").unwrap(),
+ ///
SessionContext::parse_capacity_limit("datafusion.runtime.memory_limit",
"1M").unwrap(),
/// 1024 * 1024
/// );
/// assert_eq!(
- /// SessionContext::parse_memory_limit("1.5G").unwrap(),
+ ///
SessionContext::parse_capacity_limit("datafusion.runtime.memory_limit",
"1.5G").unwrap(),
/// (1.5 * 1024.0 * 1024.0 * 1024.0) as usize
/// );
/// ```
- pub fn parse_memory_limit(limit: &str) -> Result<usize> {
Review Comment:
Makes sense. Added deprecated attribute to old `parse_memory_limit `
function.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]