@@ -163,14 +163,27 @@ async fn test_json_get_array_with_path() {
163163
164164#[ tokio:: test]
165165async fn test_json_get_equals ( ) {
166- let e = run_query ( r"select name, json_get(json_data, 'foo')='abc' from test" )
166+ // union comparison now works thanks to the union coercions upport in datafusion
167+ // (previously failed with "Cannot infer common argument type for comparison operation Union")
168+ // see https://github.com/apache/datafusion/issues/10180
169+ let batches = run_query ( r"select name, json_get(json_data, 'foo')='abc' from test" )
167170 . await
168- . unwrap_err ( ) ;
171+ . unwrap ( ) ;
169172
170- // see https://github.com/apache/datafusion/issues/10180
171- assert ! ( e
172- . to_string( )
173- . starts_with( "Error during planning: Cannot infer common argument type for comparison operation Union" ) ) ;
173+ let expected = [
174+ "+------------------+----------------------------------------------------+" ,
175+ r#"| name | json_get(test.json_data,Utf8("foo")) = Utf8("abc") |"# ,
176+ "+------------------+----------------------------------------------------+" ,
177+ "| object_foo | true |" ,
178+ "| object_foo_array | |" ,
179+ "| object_foo_obj | |" ,
180+ "| object_foo_null | |" ,
181+ "| object_bar | |" ,
182+ "| list_foo | |" ,
183+ "| invalid_json | |" ,
184+ "+------------------+----------------------------------------------------+" ,
185+ ] ;
186+ assert_batches_eq ! ( expected, & batches) ;
174187}
175188
176189#[ tokio:: test]
0 commit comments