vbarua commented on code in PR #13803:
URL: https://github.com/apache/datafusion/pull/13803#discussion_r1889343110


##########
datafusion/substrait/tests/cases/roundtrip_logical_plan.rs:
##########
@@ -977,6 +984,43 @@ async fn new_test_grammar() -> Result<()> {
     .await
 }
 
+struct MockSubstraitConsumer {
+    extensions: Extensions,
+    state: SessionState,
+}
+
+#[async_trait]
+impl SubstraitConsumer for MockSubstraitConsumer {
+    async fn resolve_table_ref(
+        &self,
+        _: &TableReference,
+    ) -> Result<Option<Arc<dyn TableProvider>>> {
+        not_impl_err!("MockSubstraitConsumer does not implement 
resolve_table_ref")
+    }
+
+    fn get_extensions(&self) -> &Extensions {
+        &self.extensions
+    }
+
+    fn get_state(&self) -> &SessionState {
+        &self.state
+    }
+
+    async fn consume_extension_leaf(
+        &self,
+        rel: &ExtensionLeafRel,
+    ) -> Result<LogicalPlan> {
+        let Some(ext_detail) = &rel.detail else {
+            return substrait_err!("Unexpected empty detail in 
ExtensionLeafRel");
+        };
+        let plan = self
+            .state
+            .serializer_registry()
+            .deserialize_logical_plan(&ext_detail.type_url, 
&ext_detail.value)?;

Review Comment:
   > As a side note, this may sound hypocritical, given that I made it even 
worse https://github.com/apache/datafusion/pull/13772
   
   I don't think it's hypocritical, you were aiming for consistency and I'm 
just being much more aggressive with my changes and breaking the API.
   
   



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