File tree 3 files changed +311
-237
lines changed
optimizer/src/optimize_projections
3 files changed +311
-237
lines changed Original file line number Diff line number Diff line change @@ -347,9 +347,22 @@ impl DFSchema {
347
347
matches. next ( )
348
348
}
349
349
350
- /// Find the index of the column with the given qualifier and name
351
- pub fn index_of_column ( & self , col : & Column ) -> Result < usize > {
350
+ /// Find the index of the column with the given qualifier and name,
351
+ /// returning `None` if not found
352
+ ///
353
+ /// See [Self::index_of_column] for a version that returns an error if the
354
+ /// column is not found
355
+ pub fn maybe_index_of_column ( & self , col : & Column ) -> Option < usize > {
352
356
self . index_of_column_by_name ( col. relation . as_ref ( ) , & col. name )
357
+ }
358
+
359
+ /// Find the index of the column with the given qualifier and name,
360
+ /// returning `Err` if not found
361
+ ///
362
+ /// See [Self::maybe_index_of_column] for a version that returns `None` if
363
+ /// the column is not found
364
+ pub fn index_of_column ( & self , col : & Column ) -> Result < usize > {
365
+ self . maybe_index_of_column ( col)
353
366
. ok_or_else ( || field_not_found ( col. relation . clone ( ) , & col. name , self ) )
354
367
}
355
368
You can’t perform that action at this time.
0 commit comments