@@ -9,6 +9,7 @@ use crate::execution::ExecutorError;
99use crate :: expression:: ScalarExpression ;
1010use crate :: planner:: operator:: join:: { JoinCondition , JoinOperator , JoinType } ;
1111use crate :: storage:: Storage ;
12+ use crate :: types:: errors:: TypeError ;
1213use crate :: types:: tuple:: Tuple ;
1314use crate :: types:: value:: DataValue ;
1415
@@ -63,7 +64,7 @@ impl HashJoin {
6364 #[ for_await]
6465 for tuple in left_input {
6566 let tuple: Tuple = tuple?;
66- let hash = Self :: hash_row ( & on_left_keys, & hash_random_state, & tuple) ;
67+ let hash = Self :: hash_row ( & on_left_keys, & hash_random_state, & tuple) ? ;
6768
6869 if !left_init_flag {
6970 Self :: columns_filling ( & tuple, & mut join_columns, left_force_nullable) ;
@@ -82,7 +83,7 @@ impl HashJoin {
8283 for tuple in right_input {
8384 let tuple: Tuple = tuple?;
8485 let right_cols_len = tuple. columns . len ( ) ;
85- let hash = Self :: hash_row ( & on_right_keys, & hash_random_state, & tuple) ;
86+ let hash = Self :: hash_row ( & on_right_keys, & hash_random_state, & tuple) ? ;
8687
8788 if !right_init_flag {
8889 Self :: columns_filling ( & tuple, & mut join_columns, right_force_nullable) ;
@@ -122,7 +123,7 @@ impl HashJoin {
122123 let mut filter_tuples = Vec :: with_capacity ( join_tuples. len ( ) ) ;
123124
124125 for mut tuple in join_tuples {
125- if let DataValue :: Boolean ( option) = expr. eval_column ( & tuple) . as_ref ( ) {
126+ if let DataValue :: Boolean ( option) = expr. eval_column ( & tuple) ? . as_ref ( ) {
126127 if let Some ( false ) | None = option {
127128 let full_cols_len = tuple. columns . len ( ) ;
128129 let left_cols_len = full_cols_len - right_cols_len;
@@ -200,13 +201,14 @@ impl HashJoin {
200201 on_keys : & [ ScalarExpression ] ,
201202 hash_random_state : & RandomState ,
202203 tuple : & Tuple
203- ) -> u64 {
204- let values = on_keys
205- . iter ( )
206- . map ( |expr| expr. eval_column ( tuple) )
207- . collect_vec ( ) ;
204+ ) -> Result < u64 , TypeError > {
205+ let mut values = Vec :: with_capacity ( on_keys. len ( ) ) ;
206+
207+ for expr in on_keys {
208+ values. push ( expr. eval_column ( tuple) ?) ;
209+ }
208210
209- hash_random_state. hash_one ( values)
211+ Ok ( hash_random_state. hash_one ( values) )
210212 }
211213}
212214
0 commit comments