@@ -22,8 +22,8 @@ pub mod memory;
2222pub mod proxy;
2323pub mod string_utils;
2424
25- use crate :: error:: { _exec_datafusion_err, _internal_err} ;
26- use crate :: { DataFusionError , Result , ScalarValue } ;
25+ use crate :: error:: { _exec_datafusion_err, _internal_datafusion_err , _internal_err} ;
26+ use crate :: { Result , ScalarValue } ;
2727use arrow:: array:: {
2828 cast:: AsArray , Array , ArrayRef , FixedSizeListArray , LargeListArray , ListArray ,
2929 OffsetSizeTrait ,
@@ -147,9 +147,7 @@ pub fn bisect<const SIDE: bool>(
147147 let low: usize = 0 ;
148148 let high: usize = item_columns
149149 . first ( )
150- . ok_or_else ( || {
151- DataFusionError :: Internal ( "Column array shouldn't be empty" . to_string ( ) )
152- } ) ?
150+ . ok_or_else ( || _internal_datafusion_err ! ( "Column array shouldn't be empty" ) ) ?
153151 . len ( ) ;
154152 let compare_fn = |current : & [ ScalarValue ] , target : & [ ScalarValue ] | {
155153 let cmp = compare_rows ( current, target, sort_options) ?;
@@ -198,9 +196,7 @@ pub fn linear_search<const SIDE: bool>(
198196 let low: usize = 0 ;
199197 let high: usize = item_columns
200198 . first ( )
201- . ok_or_else ( || {
202- DataFusionError :: Internal ( "Column array shouldn't be empty" . to_string ( ) )
203- } ) ?
199+ . ok_or_else ( || _internal_datafusion_err ! ( "Column array shouldn't be empty" ) ) ?
204200 . len ( ) ;
205201 let compare_fn = |current : & [ ScalarValue ] , target : & [ ScalarValue ] | {
206202 let cmp = compare_rows ( current, target, sort_options) ?;
@@ -365,9 +361,7 @@ pub fn get_at_indices<T: Clone, I: Borrow<usize>>(
365361 . map ( |idx| items. get ( * idx. borrow ( ) ) . cloned ( ) )
366362 . collect :: < Option < Vec < T > > > ( )
367363 . ok_or_else ( || {
368- DataFusionError :: Execution (
369- "Expects indices to be in the range of searched vector" . to_string ( ) ,
370- )
364+ _exec_datafusion_err ! ( "Expects indices to be in the range of searched vector" )
371365 } )
372366}
373367
@@ -808,7 +802,7 @@ pub fn find_indices<T: PartialEq, S: Borrow<T>>(
808802 . into_iter ( )
809803 . map ( |target| items. iter ( ) . position ( |e| target. borrow ( ) . eq ( e) ) )
810804 . collect :: < Option < _ > > ( )
811- . ok_or_else ( || DataFusionError :: Execution ( "Target not found" . to_string ( ) ) )
805+ . ok_or_else ( || _exec_datafusion_err ! ( "Target not found" ) )
812806}
813807
814808/// Transposes the given vector of vectors.
0 commit comments