milenkovicm commented on code in PR #1420:
URL: 
https://github.com/apache/datafusion-ballista/pull/1420#discussion_r2817522323


##########
ballista/client/tests/context_unsupported.rs:
##########


Review Comment:
   i guess we should move this to other test, as it is not expected to fail



##########
ballista/client/tests/context_unsupported.rs:
##########
@@ -143,4 +149,52 @@ mod unsupported {
 
         Ok(())
     }
+
+    #[rstest]
+    #[case::standalone(standalone_context())]
+    #[case::remote(remote_context())]
+    #[tokio::test]
+    async fn should_support_on_cache_collect(
+        #[future(awt)]
+        #[case]
+        ctx: SessionContext,
+    ) -> datafusion::error::Result<()> {
+        // opt out case, should fail
+        ctx.sql("SET ballista.cache_noop = false")
+            .await?
+            .show()
+            .await?;
+        let cached_df = ctx.sql("SELECT 1").await?.cache().await?;
+
+        // Collect fails because extension node is not handled for now by 
default query planner
+        let result = cached_df.collect().await;
+
+        assert!(result.is_err());
+        let err_msg = result.unwrap_err().to_string();
+        assert!(
+            err_msg.contains("No installed planner was able to convert the 
custom node to an execution plan: BallistaCacheNode"),
+            "Expected planner error, got: {err_msg}"
+        );
+
+        // opt in case, should succeed transparently without effective cache
+        ctx.sql("SET ballista.cache_noop = true")
+            .await?
+            .show()
+            .await?;
+        let cached_df = ctx.sql("SELECT 1").await?.cache().await?;
+        // Collect does not fail because cache is ignored silently with 
cache_noop
+        let result = cached_df.collect().await;
+
+        assert!(result.is_ok());
+        let expected = [
+            "+----------+",
+            "| Int64(1) |",
+            "+----------+",
+            "| 1        |",
+            "+----------+",
+        ];
+        assert_batches_eq!(expected, &result?);
+

Review Comment:
   we have other test to test this 



-- 
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]

Reply via email to