martin-g commented on code in PR #18688:
URL: https://github.com/apache/datafusion/pull/18688#discussion_r2526201310
##########
datafusion/core/tests/dataframe/mod.rs:
##########
@@ -2338,6 +2338,29 @@ async fn cache_test() -> Result<()> {
Ok(())
}
+#[tokio::test]
+async fn cache_producer_test() -> Result<()> {
+ let df = test_table_with_cache_producer()
+ .await?
+ .select_columns(&["c2", "c3"])?
+ .limit(0, Some(1))?
+ .with_column("sum", cast(col("c2") + col("c3"), DataType::Int64))?;
+
+ let cached_df = df.clone().cache().await?;
+
+ assert_snapshot!(
+ cached_df.clone().into_optimized_plan().unwrap(),
+ @r###"
+ CacheNode
+ Projection: aggregate_test_100.c2, aggregate_test_100.c3,
CAST(CAST(aggregate_test_100.c2 AS Int64) + CAST(aggregate_test_100.c3 AS
Int64) AS Int64) AS sum
+ Projection: aggregate_test_100.c2, aggregate_test_100.c3
+ Limit: skip=0, fetch=1
+ TableScan: aggregate_test_100, fetch=1
+ "###
+ );
Review Comment:
```suggestion
);
let df_results = df.collect().await?;
let cached_df_results = cached_df.collect().await?;
assert_eq!(&df_results, &cached_df_results);
```
to test the physical plan too
Does it need a custom ExtensionPlanner too for that ?!
##########
datafusion/core/src/dataframe/mod.rs:
##########
Review Comment:
This needs to be updated to mention the custom cache path.
Something like:
```
Cache this DataFrame using the configured cache producer, falling back to an
in-memory table when none is set
```
--
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]