Dandandan commented on code in PR #2885:
URL: https://github.com/apache/arrow-datafusion/pull/2885#discussion_r919263175


##########
datafusion/optimizer/src/optimizer.rs:
##########
@@ -44,15 +44,23 @@ pub struct OptimizerConfig {
     /// Query execution start time that can be used to rewrite expressions 
such as `now()`
     /// to use a literal value instead
     pub query_execution_start_time: DateTime<Utc>,
+    next_id: usize,
 }
 
 impl OptimizerConfig {
     /// Create optimizer config
     pub fn new() -> Self {
         Self {
             query_execution_start_time: chrono::Utc::now(),
+            next_id: 1,
         }
     }
+
+    pub fn next_id(&mut self) -> usize {
+        let id = self.next_id;
+        self.next_id += 1;
+        id

Review Comment:
   ```suggestion
           self.cur_id += 1;
           self.cur_id
   ```
   And start cur_id at 0? 



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

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

Reply via email to