alamb commented on code in PR #10216:
URL: https://github.com/apache/datafusion/pull/10216#discussion_r1578379676


##########
datafusion/common/src/dfschema.rs:
##########
@@ -347,7 +347,20 @@ impl DFSchema {
         matches.next()
     }
 
-    /// Find the index of the column with the given qualifier and name
+    /// Find the index of the column with the given qualifier and name,
+    /// returning `None` if not found
+    ///
+    /// See [Self::index_of_column] for a version that returns an error if the
+    /// column is not found
+    pub fn maybe_index_of_column(&self, col: &Column) -> Option<usize> {
+        self.index_of_column_by_name(col.relation.as_ref(), &col.name)

Review Comment:
   This hung me up for a while -- the original code uses `flat_map` which 
discards the `Err` if the column is not found, was not obvious to me



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