@@ -25,6 +25,7 @@ use std::sync::Arc;
2525use crate :: url:: ListingTableUrl ;
2626use crate :: write:: FileSinkConfig ;
2727use datafusion_common:: error:: Result ;
28+ use datafusion_common:: file_options:: file_type:: SINGLE_FILE_EXTENSION ;
2829use datafusion_physical_plan:: SendableRecordBatchStream ;
2930
3031use arrow:: array:: {
@@ -101,19 +102,21 @@ pub(crate) fn start_demuxer_task(
101102 let file_extension = config. file_extension . clone ( ) ;
102103 let base_output_path = config. table_paths [ 0 ] . clone ( ) ;
103104 let task = if config. table_partition_cols . is_empty ( ) {
105+ let dot_free = SINGLE_FILE_EXTENSION . replace ( "." , "" ) ;
104106 let single_file_output = ( !base_output_path. is_collection ( )
105107 && base_output_path. file_extension ( ) . is_some ( ) )
106- || base_output_path. file_extension ( ) == Some ( "single" ) ;
108+ || base_output_path. file_extension ( ) == Some ( & dot_free ) ;
107109
108110 let file_extension = if single_file_output {
109- file_extension. replace ( ".single" , "" )
111+ file_extension. replace ( SINGLE_FILE_EXTENSION , "" )
110112 } else {
111113 file_extension
112114 } ;
113115
114- let base_output_path =
115- ListingTableUrl :: parse ( base_output_path. as_str ( ) . replace ( ".single" , "" ) )
116- . unwrap_or ( base_output_path) ;
116+ let base_output_path = ListingTableUrl :: parse (
117+ base_output_path. as_str ( ) . replace ( SINGLE_FILE_EXTENSION , "" ) ,
118+ )
119+ . unwrap_or ( base_output_path) ;
117120 SpawnedTask :: spawn ( async move {
118121 row_count_demuxer (
119122 tx,
0 commit comments