File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1400,4 +1400,34 @@ mod test {
1400
1400
assert_eq ! ( expected, actual) ;
1401
1401
Ok ( ( ) )
1402
1402
}
1403
+
1404
+ #[ test]
1405
+ fn test_arrow_string_view_setting ( ) -> Result < ( ) > {
1406
+ // Test that only one setting doesn't work (missing arrow_output_version)
1407
+ {
1408
+ let config = Config :: default ( ) . with ( "produce_arrow_string_view" , "true" ) ?;
1409
+ let conn = Connection :: open_in_memory_with_flags ( config) ?;
1410
+
1411
+ let mut query = conn. prepare ( "SELECT 'test'::varchar AS str" ) ?;
1412
+ let arrow = query. query_arrow ( [ ] ) ?;
1413
+
1414
+ let batch = arrow. into_iter ( ) . next ( ) . expect ( "Expected at least one batch" ) ;
1415
+ assert_eq ! ( batch. schema( ) . field( 0 ) . data_type( ) , & DataType :: Utf8 ) ;
1416
+ }
1417
+
1418
+ {
1419
+ let config = Config :: default ( )
1420
+ . with ( "produce_arrow_string_view" , "true" ) ?
1421
+ . with ( "arrow_output_version" , "1.4" ) ?;
1422
+ let conn = Connection :: open_in_memory_with_flags ( config) ?;
1423
+
1424
+ let mut query = conn. prepare ( "SELECT 'test'::varchar AS str" ) ?;
1425
+ let arrow = query. query_arrow ( [ ] ) ?;
1426
+
1427
+ let batch = arrow. into_iter ( ) . next ( ) . expect ( "Expected at least one batch" ) ;
1428
+ assert_eq ! ( batch. schema( ) . field( 0 ) . data_type( ) , & DataType :: Utf8View ) ;
1429
+ }
1430
+
1431
+ Ok ( ( ) )
1432
+ }
1403
1433
}
You can’t perform that action at this time.
0 commit comments