File tree Expand file tree Collapse file tree
expr-common/src/type_coercion/binary/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818use super :: * ;
1919use datafusion_common:: assert_contains;
2020
21- #[ test]
22- fn test_coercion_error ( ) -> Result < ( ) > {
23- let coercer =
24- BinaryTypeCoercer :: new ( & DataType :: Float32 , & Operator :: Plus , & DataType :: Utf8 ) ;
25- let result_type = coercer. get_input_types ( ) ;
26-
27- let e = result_type. unwrap_err ( ) ;
28- assert_eq ! (
29- e. strip_backtrace( ) ,
30- "Error during planning: Cannot coerce arithmetic expression Float32 + Utf8 to valid types"
31- ) ;
32- Ok ( ( ) )
33- }
34-
3521#[ test]
3622fn test_date_timestamp_arithmetic_error ( ) -> Result < ( ) > {
3723 let ( lhs, rhs) = BinaryTypeCoercer :: new (
Original file line number Diff line number Diff line change @@ -202,20 +202,6 @@ fn test_ambiguous_reference() -> Result<()> {
202202 Ok ( ( ) )
203203}
204204
205- #[ test]
206- fn test_incompatible_types_binary_arithmetic ( ) -> Result < ( ) > {
207- let query = "SELECT /*whole+left*/id/*left*/ + /*right*/first_name/*right+whole*/ FROM person" ;
208- let spans = get_spans ( query) ;
209- let diag = do_query ( query) ;
210- assert_snapshot ! ( diag. message, @"expressions have incompatible types" ) ;
211- assert_eq ! ( diag. span, Some ( spans[ "whole" ] ) ) ;
212- assert_snapshot ! ( diag. notes[ 0 ] . message, @"has type UInt32" ) ;
213- assert_eq ! ( diag. notes[ 0 ] . span, Some ( spans[ "left" ] ) ) ;
214- assert_snapshot ! ( diag. notes[ 1 ] . message, @"has type Utf8" ) ;
215- assert_eq ! ( diag. notes[ 1 ] . span, Some ( spans[ "right" ] ) ) ;
216- Ok ( ( ) )
217- }
218-
219205#[ test]
220206fn test_field_not_found_suggestion ( ) -> Result < ( ) > {
221207 let query = "SELECT /*whole*/first_na/*whole*/ FROM person" ;
You can’t perform that action at this time.
0 commit comments