clflushopt commented on code in PR #23488:
URL: https://github.com/apache/datafusion/pull/23488#discussion_r3588999618


##########
datafusion/substrait/src/logical_plan/producer/substrait_producer.rs:
##########
@@ -441,6 +450,30 @@ pub trait SubstraitProducer: Send + Sync + Sized {
         from_placeholder(self, placeholder)
     }
 
+    // Outer Schema management API.
+    //
+    // These methods manage a stack of outer schemas for correlated subquery 
support
+    // such as when entering a subquery, the enclosing query's schema is 
pushed onto
+    // the stack.
+    //
+    // Serializing an Expr::OuterReferenceColumn uses these to resolve the 
column
+    // against the correct enclosing query and emit an OuterReference field 
reference
+    // with the corresponding `steps_out`.
+
+    /// Push an outer schema onto the stack when entering a subquery.
+    fn push_outer_schema(&mut self, _schema: DFSchemaRef) {}
+
+    /// Pop an outer schema from the stack when leaving a subquery.
+    fn pop_outer_schema(&mut self) {}
+
+    /// Get the outer schema at the given nesting depth.
+    /// `steps_out = 1` is the immediately enclosing query, `steps_out = 2`
+    /// is two levels out, etc. Returns `None` if `steps_out` is 0 or
+    /// exceeds the current nesting depth.
+    fn get_outer_schema(&self, _steps_out: usize) -> Option<DFSchemaRef> {
+        None
+    }

Review Comment:
   I believe it would break existing custom producers that serialize substraits 
because it would be invoked on every substrait boundary. The choice of 
defaulting to noops `None` is to match the consumer side as well which has the 
same default behaviour.



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