File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -819,6 +819,23 @@ async fn test_long_arrow_eq_str() {
819819 assert_batches_eq ! ( expected, & batches) ;
820820}
821821
822+ #[ tokio:: test]
823+ async fn test_arrow_cast_key_text ( ) {
824+ let sql = r#"select ('{"foo": 42}'->('foo'::text))"# ;
825+ let batches = run_query ( sql) . await . unwrap ( ) ;
826+
827+ let expected = [
828+ "+------------------------+" ,
829+ "| '{\" foo\" : 42}' -> 'foo' |" ,
830+ "+------------------------+" ,
831+ "| {int=42} |" ,
832+ "+------------------------+" ,
833+ ] ;
834+ assert_batches_eq ! ( expected, & batches) ;
835+
836+ assert_eq ! ( display_val( batches) . await , ( DataType :: Int64 , "42" . to_string( ) ) ) ;
837+ }
838+
822839#[ tokio:: test]
823840async fn test_arrow_cast_int ( ) {
824841 let sql = r#"select ('{"foo": 42}'->'foo')::int"# ;
You can’t perform that action at this time.
0 commit comments