andygrove commented on code in PR #2886:
URL: 
https://github.com/apache/datafusion-ballista/pull/2886#discussion_r4643077140


##########
ballista/core/src/extension.rs:
##########
@@ -131,6 +142,13 @@ pub trait SessionConfigExt {
     /// or default ballista codec if not
     fn ballista_physical_extension_codec(&self) -> Arc<dyn 
PhysicalExtensionCodec>;
 
+    /// Returns the resolver for restricting custom plan nodes to a task's 
partitions.
+    ///
+    /// Returns `None` if not set.
+    fn ballista_partition_sliceable_resolver(

Review Comment:
   Optional thought. `ballista_partition_sliceable_resolver` could default to 
`None` so outside implementors of `SessionConfigExt` only have to add the 
setter. Totally fine as is given the upgrade note.



##########
ballista/client/tests/context_setup.rs:
##########
@@ -184,6 +185,26 @@ mod standalone {
         Ok(())
     }
 
+    #[tokio::test]
+    async fn should_set_partition_sliceable_resolver() -> 
datafusion::error::Result<()> {
+        let resolver = Arc::new(MockPartitionSliceableResolver::default());
+        let session_config = SessionConfig::new_with_ballista()
+            .with_ballista_partition_sliceable_resolver(resolver.clone());
+
+        let state = state_with_config(session_config);
+        let ctx = SessionContext::standalone_with_state(state).await?;
+
+        register_alltypes(&ctx, "test").await;
+
+        // Execute a query to verify that the standalone scheduler uses the
+        // resolver registered in the session configuration.
+        ctx.sql(ALLTYPES_GROUP_BY_SQL).await?.collect().await?;

Review Comment:
   The test is a nice, direct check that the resolver is consulted. Could it 
also compare the collected batches with `ALLTYPES_GROUP_BY`? That would show 
that a resolver returning `None` leaves results unchanged.



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