alamb commented on code in PR #14329: URL: https://github.com/apache/datafusion/pull/14329#discussion_r1937048640
########## datafusion/expr/src/logical_plan/extension.rs: ########## @@ -54,6 +57,22 @@ pub trait UserDefinedLogicalNode: fmt::Debug + Send + Sync { /// Return the output schema of this logical plan node. fn schema(&self) -> &DFSchemaRef; + /// Return the list of invariants. + /// + /// Implementing this function enables the user to define the + /// invariants for a given logical plan extension. + fn invariants(&self) -> Vec<Invariant> { + vec![] + } + + /// Perform check of invariants for the extension node. + fn check_invariants(&self, check: InvariantLevel, plan: &LogicalPlan) -> Result<()> { Review Comment: > However, if we are not going to do this follow up bit -- then yes I reocmmend this be the last PR for a while. My rationale is 1. you have added a nice API but there aren't many uses of it in the code base yet and thus we are speculating (likely correctly) on the value of additional APIs 2. Users can implement checks for existing LogicalPlans using existing APIs (not as nicely, but they could write their own pass) So let's wrap this one up, and then focus on using what we have to make the code better -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org