You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "waynexia (via GitHub)" <gi...@apache.org> on 2023/04/11 13:19:15 UTC

[GitHub] [arrow-datafusion] waynexia commented on a diff in pull request #5963: feat: allow the customization of analyzer rules

waynexia commented on code in PR #5963:
URL: https://github.com/apache/arrow-datafusion/pull/5963#discussion_r1162806690


##########
datafusion/optimizer/src/optimizer.rs:
##########
@@ -244,12 +256,18 @@ impl Optimizer {
             Arc::new(PushDownLimit::new()),
         ];
 
-        Self::with_rules(rules)
+        Self::with_rules(analyzer_rules, rules)
     }
 
     /// Create a new optimizer with the given rules
-    pub fn with_rules(rules: Vec<Arc<dyn OptimizerRule + Send + Sync>>) -> Self {
-        Self { rules }
+    pub fn with_rules(
+        analyzer_rules: Vec<Arc<dyn AnalyzerRule + Send + Sync>>,
+        rules: Vec<Arc<dyn OptimizerRule + Send + Sync>>,
+    ) -> Self {
+        Self {
+            analyzer_rules,
+            rules,
+        }
     }

Review Comment:
   I'm unsure if this is a proper place to customize analyzer rules. But from the code structure `Analyzer` is part of `Optimizer`. And only `Optimizer` is exposed to the context. Please let me know what you think @alamb @jackwener 



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org