@@ -28,6 +28,7 @@ mod supported {
2828 use datafusion:: prelude:: * ;
2929 use datafusion:: { assert_batches_eq, prelude:: SessionContext } ;
3030 use rstest:: * ;
31+ use std:: path:: PathBuf ;
3132
3233 #[ rstest:: fixture]
3334 fn test_data ( ) -> String {
@@ -714,17 +715,22 @@ mod supported {
714715 ] ;
715716
716717 let write_dir = tempfile:: tempdir ( ) . expect ( "temporary directory to be created" ) ;
717- let write_dir_path = write_dir
718- . path ( )
719- . to_str ( )
720- . expect ( "path to be converted to str" ) ;
718+ let write_dir_path = PathBuf :: from (
719+ write_dir
720+ . path ( )
721+ . to_str ( )
722+ . expect ( "path to be converted to str" ) ,
723+ ) ;
724+
725+ let parquet_file = write_dir_path. join ( "p_written_table.parquet" ) ;
726+ let parquet_file = parquet_file. to_str ( ) . expect ( "cannot create csv file" ) ;
721727
722728 ctx. sql ( "select * from test" )
723729 . await ?
724- . write_parquet ( write_dir_path , Default :: default ( ) , Default :: default ( ) )
730+ . write_parquet ( parquet_file , Default :: default ( ) , Default :: default ( ) )
725731 . await ?;
726732
727- ctx. register_parquet ( "p_written_table" , write_dir_path , Default :: default ( ) )
733+ ctx. register_parquet ( "p_written_table" , parquet_file , Default :: default ( ) )
728734 . await ?;
729735
730736 let result = ctx
@@ -735,12 +741,15 @@ mod supported {
735741
736742 assert_batches_eq ! ( expected, & result) ;
737743
744+ let csv_file = write_dir_path. join ( "c_written_table.csv" ) ;
745+ let csv_file = csv_file. to_str ( ) . expect ( "cannot create csv file" ) ;
746+
738747 ctx. sql ( "select * from test" )
739748 . await ?
740- . write_csv ( write_dir_path , Default :: default ( ) , Default :: default ( ) )
749+ . write_csv ( csv_file , Default :: default ( ) , Default :: default ( ) )
741750 . await ?;
742751
743- ctx. register_csv ( "c_written_table" , write_dir_path , Default :: default ( ) )
752+ ctx. register_csv ( "c_written_table" , csv_file , Default :: default ( ) )
744753 . await ?;
745754
746755 let result = ctx
@@ -751,12 +760,15 @@ mod supported {
751760
752761 assert_batches_eq ! ( expected, & result) ;
753762
763+ let json_file = write_dir_path. join ( "j_written_table.json" ) ;
764+ let json_file = json_file. to_str ( ) . expect ( "cannot create csv file" ) ;
765+
754766 ctx. sql ( "select * from test" )
755767 . await ?
756- . write_json ( write_dir_path , Default :: default ( ) , Default :: default ( ) )
768+ . write_json ( json_file , Default :: default ( ) , Default :: default ( ) )
757769 . await ?;
758770
759- ctx. register_json ( "j_written_table" , write_dir_path , Default :: default ( ) )
771+ ctx. register_json ( "j_written_table" , json_file , Default :: default ( ) )
760772 . await ?;
761773
762774 let result = ctx
@@ -1048,13 +1060,12 @@ mod supported {
10481060 "| | EmptyRelation: rows=1 |" ,
10491061 "| physical_plan | ProjectionExec: expr=[count(Int64(1))@1 as count(*), id@0 as id] |" ,
10501062 "| | AggregateExec: mode=FinalPartitioned, gby=[id@0 as id], aggr=[count(Int64(1))] |" ,
1051- "| | CoalesceBatchesExec: target_batch_size=8192 |" ,
1052- "| | RepartitionExec: partitioning=Hash([id@0], 16), input_partitions=1 |" ,
1053- "| | AggregateExec: mode=Partial, gby=[id@0 as id], aggr=[count(Int64(1))] |" ,
1054- "| | ProjectionExec: expr=[__unnest_placeholder(make_array(Int64(1),Int64(2),Int64(3),Int64(4),Int64(5)),depth=1)@0 as id] |" ,
1055- "| | UnnestExec |" ,
1056- "| | ProjectionExec: expr=[[1, 2, 3, 4, 5] as __unnest_placeholder(make_array(Int64(1),Int64(2),Int64(3),Int64(4),Int64(5)))] |" ,
1057- "| | PlaceholderRowExec |" ,
1063+ "| | RepartitionExec: partitioning=Hash([id@0], 16), input_partitions=1 |" ,
1064+ "| | AggregateExec: mode=Partial, gby=[id@0 as id], aggr=[count(Int64(1))] |" ,
1065+ "| | ProjectionExec: expr=[__unnest_placeholder(make_array(Int64(1),Int64(2),Int64(3),Int64(4),Int64(5)),depth=1)@0 as id] |" ,
1066+ "| | UnnestExec |" ,
1067+ "| | ProjectionExec: expr=[[1, 2, 3, 4, 5] as __unnest_placeholder(make_array(Int64(1),Int64(2),Int64(3),Int64(4),Int64(5)))] |" ,
1068+ "| | PlaceholderRowExec |" ,
10581069 "| | |" ,
10591070 "| distributed_plan | =========ResolvedStage[stage_id=1.0, partitions=1]========= |" ,
10601071 "| | ShuffleWriterExec: partitioning: Hash([id@0], 16) |" ,
@@ -1069,8 +1080,7 @@ mod supported {
10691080 "| | ShuffleWriterExec: partitioning: None |" ,
10701081 "| | ProjectionExec: expr=[count(Int64(1))@1 as count(*), id@0 as id] |" ,
10711082 "| | AggregateExec: mode=FinalPartitioned, gby=[id@0 as id], aggr=[count(Int64(1))] |" ,
1072- "| | CoalesceBatchesExec: target_batch_size=8192 |" ,
1073- "| | UnresolvedShuffleExec: partitioning: Hash([id@0], 16) |" ,
1083+ "| | UnresolvedShuffleExec: partitioning: Hash([id@0], 16) |" ,
10741084 "| | |" ,
10751085 "| | |" ,
10761086 "+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+" ,
0 commit comments