milenkovicm commented on code in PR #18688:
URL: https://github.com/apache/datafusion/pull/18688#discussion_r2543317304
##########
datafusion/core/src/execution/session_state.rs:
##########
@@ -90,6 +90,13 @@ use sqlparser::{
use url::Url;
use uuid::Uuid;
+/// A [`CacheFactory`] can be registered via [`SessionState`]
+/// to create a custom logical plan for caching.
+/// Additionally, a custom
[`crate::physical_planner::ExtensionPlanner`]/[`QueryPlanner`]
+/// may need to be implemented to handle such plans.
+pub type CacheFactory =
Review Comment:
I believe previous approach made more sense, this one can accept only fn
```rust
/// Interface for applying a custom caching strategy.
/// Implement this trait and register via [`SessionState`]
/// to create a custom logical node for caching.
/// Additionally, a custom
[`crate::physical_planner::ExtensionPlanner`]/[`QueryPlanner`]
/// need to be implemented to handle plans containing such node.
pub trait CacheFactory: Debug + Sync + Send {
/// Create a custom logical node for caching
/// given a logical plan (of DF to cache) and a session state.
fn create(
&self,
plan: LogicalPlan,
session_state: &SessionState,
) -> Result<Arc<dyn UserDefinedLogicalNode>>;
}
```
would it be possible to get it back please?
##########
datafusion/core/src/dataframe/mod.rs:
##########
@@ -2328,7 +2328,8 @@ impl DataFrame {
})
}
- /// Cache DataFrame as a memory table.
+ /// Cache DataFrame as a memory table by default, or use
Review Comment:
I would suggest
```
/// Cache DataFrame as a memory table.
///
/// Default behaviour could be changed using
[`crate::execution::session_state::CacheFactory`]
/// configured via [`SessionState`],
```
--
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]