alamb opened a new issue, #10846:
URL: https://github.com/apache/datafusion/issues/10846

   ### Is your feature request related to a problem or challenge?
   
   @goldmedal  reports on discord: 
https://discord.com/channels/885562378132000778/1166447479609376850/1249052209388326922
   
   Hi, I tried to implement some AnalyzerRule to rewrite and analyze the 
logical plan. I have implemented the AnalyzerRules that work fine with 
Analyzer::with_rules. However, when I tried to register them to the 
SessionContext, I couldn't find any method for it. I can only do something like:
   
   ```rust
   let ctx = SessionContext::new();
   let new_st = 
ctx.state().add_analyzer_rule(Arc::new(ModelAnalyzeRule::new(Arc::clone(&analyzed_mdl))));
   let new_st = 
new_st.add_analyzer_rule(Arc::new(ModelGenerationRule::new(Arc::clone(&analyzed_mdl))));
   let new_ctx = SessionContext::new_with_state(new_st);
   ```
   
   The new session context works fine with the rules I added, but I can't find 
a way to register the rules to the session context directly.
   
   Does this approach make sense? Or is there a better way to do this?
   
   Is there any method like SessionContext::register_analyzer_rule that can add 
the rules to the analyzer rules list?
   
   ### Describe the solution you'd like
   
   I would like a function on `SessionContext` that can update the analyzer 
rules directly
   
   
   ### Describe alternatives you've considered
   
   I suggest adding `SessionContext::add_analyzer_rule` that simply calls 
`SessionState::add_analyzer_rule`
   
   ### Additional context
   
   _No response_


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

Reply via email to