jonahgao commented on code in PR #13609:
URL: https://github.com/apache/datafusion/pull/13609#discussion_r1864256038


##########
datafusion/sql/src/planner.rs:
##########
@@ -622,21 +622,37 @@ pub fn object_name_to_table_reference(
     idents_to_table_reference(idents, enable_normalization)
 }
 
-struct IdentTaker(Vec<Ident>);
+struct IdentTaker {
+    normalizer: IdentNormalizer,
+    idents: Vec<Ident>,
+}
+
 /// Take the next identifier from the back of idents, panic'ing if
 /// there are none left
 impl IdentTaker {
-    fn take(&mut self, enable_normalization: bool) -> String {
-        let ident = self.0.pop().expect("no more identifiers");
-        IdentNormalizer::new(enable_normalization).normalize(ident)
+    fn new(idents: Vec<Ident>, enable_normalization: bool) -> Self {
+        Self {
+            normalizer: IdentNormalizer::new(enable_normalization),
+            idents,
+        }
+    }
+
+    fn take(&mut self) -> String {
+        let ident = self.idents.pop().expect("no more identifiers");
+        self.normalizer.normalize(ident)
+    }
+
+    /// Returns the number of remaining identifiers
+    fn len(&self) -> usize {

Review Comment:
   👍



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